Description
During the Oulo meeting's LWG discussion of some filesystem issues it has been observed that some current Returns elements of fs operations unfortunately mix effects and the actual return specification in a single paragraph.
For example, in [fs.op.file_size] p1 we have
Returns: If
!exists(p) || !is_regular_file(p)
an error is reported (27.10.7). Otherwise, the
size in bytes of the filep
resolves to, determined as if by the value of the POSIXstat
structure
memberst_size
obtained as if by POSIXstat()
. The signature with argumentec
returnsstatic_- cast<uintmax_t>(-1)
if an error occurs.
Here, the part
If
!exists(p) || !is_regular_file(p)
an error is reported (27.10.7).
would better belong to a separate Effects element (such as in copy
or copy_file
). Then, the current Returns element could be rephrased as follows:
Returns: The size in bytes of the file
p
resolves to, determined as if by the value of the POSIXstat
structure memberst_size
obtained as if by POSIXstat()
. The signature with argumentec
returnsstatic_cast<uintmax_t>(-1)
if an error occurs.
A similar problem exists for [fs.op.temp_dir_path] p1, where we have
Returns: An unspecifed directory path suitable for temporary files. An error shall be reported if
!exists(p) || !is_directory(p)
, wherep
is the path to be returned. The signature with argument
ec
returnspath()
if an error occurs.
which could be split as follows:
Let
p
be the path to be returned.Effects: If
!exists(p) || !is_directory(p)
an error is reported (27.10.7).Returns: An unspecifed directory path suitable for temporary files. The signature with argument
ec
returnspath()
if an error occurs.
Is it possible to improve this situation editorially?