This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of TS status.
Section: 15.14 [filesys.ts::fs.op.file_size] Status: TS Submitter: FI-9 Opened: 2014-01-20 Last modified: 2017-08-01
Priority: Not Prioritized
View all issues with TS status.
"The signature with argument ec returns static_cast<uintmax_t>(-1) if an error occurs.", one would expect that both signatures return that if an error occurs?
Clarify the Returns clause, and apply the same for every function that returns an uintmax_t where applicable.
[2014-02-13 LWG/SG-3 Issaquah:]Discussion when around in circles for a while, until someone suggested the reference to 15.15 was wrong, and that the issue applied to the previous function in the WP, 15.14 File size [fs.op.file_size]. The NB Comment makes much more sense if it applies to file_size(), so the chair was directed to change the reference from 15.15 [fs.op.hard_lk_ct] to 15.14 [fs.op.file_size]. The intent that file_size() is only meaningful for regular_files. Beman to strike the the static_cast, changing it to "Otherwise an error is reported.".
Change 15.14 [fs.op.file_size]:
uintmax_t file_size(const path& p); uintmax_t file_size(const path& p, error_code& ec) noexcept;
exists(p), the size in bytes of the file
presolves to, determined as if by the value of the POSIX
st_sizeobtained as if by POSIX
Otherwise,The signature with argument
static_cast<uintmax_t>(-1)if an error occurs.
Throws: As specified in Error reporting .