Created on 2014-01-20.00:00:00 last changed 89 months ago
Proposed resolution:
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;
Returns: If
!exists(p)
an error is reported (7). Otherwise, the size in bytes of the file&&|| !is_regular_file(p)p
resolves to, determined as if by the value of the POSIXstat
structure memberst_size
obtained as if by POSIXstat()
.Otherwise,The signature with argumentstatic_cast<uintmax_t>(-1)
.ec
returnsstatic_cast<uintmax_t>(-1)
if an error occurs.Throws: As specified in Error reporting (7).
[ 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.".Addresses: filesys.ts
"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.
History | |||
---|---|---|---|
Date | User | Action | Args |
2017-07-30 20:10:41 | admin | set | status: wp -> open |
2016-01-28 01:00:35 | admin | set | messages: + msg7785 |
2016-01-28 01:00:35 | admin | set | messages: + msg7784 |
2014-01-20 00:00:00 | admin | create |