Created on 2016-06-06.00:00:00 last changed 89 months ago
Proposed resolution:
This wording is relative to N4594.
Insert a new paragraph before [fs.op.exists] p2 and edit it as shown:
bool exists(const path& p); bool exists(const path& p, error_code& ec) noexcept;-?- Let s be a file_status, determined as if by status(p) or status(p, ec), respectively.
-?- Effects: The signature with argument ec calls ec.clear() if status_known(s). -2- Returns:exists(status(p)) or exists(status(p, ec)), respectivelyexists(s).The signature with argument ec returns false if an error occurs.
[ 2016-06, Oulu ]
Prioritized as P1
Voted to Ready 7-0 Tuesday evening in Oulu
[ 2016-06, Oulu — Jonathan comments and provides wording ]
The sentence "The signature with argument ec returns false if an error occurs." means that given a file such that status(p).type() == file_type::unknown, exists(p) is true but exists(p, ec) is false.
I believe we should make the behaviour of exists(p) and exists(p, ec) consistent, so that the latter clears ec except when the former would throw an exception, which is only for the file_type::none case.The filesystem::exists(const path&) function does not throw an exception if the file doesn't exist, but the corresponding function taking an error_code& argument does set it to indicate an error.
It seems sensible for filesystem::exists(const path&, error_code&) to call ec.clear() if status(p, ec).type() == file_type::not_found.History | |||
---|---|---|---|
Date | User | Action | Args |
2017-07-30 20:15:43 | admin | set | status: wp -> c++17 |
2016-06-28 12:55:35 | admin | set | status: immediate -> wp |
2016-06-27 16:44:20 | admin | set | messages: + msg8210 |
2016-06-27 16:44:20 | admin | set | status: new -> immediate |
2016-06-20 15:57:37 | admin | set | messages: + msg8181 |
2016-06-20 15:57:37 | admin | set | messages: + msg8180 |
2016-06-06 00:00:00 | admin | create |