Proposed resolution:
Change 15.4 [fs.op.copy_file]:
Precondition: At most one constant from each
copy_options
option group ([enum.copy_options]) is present inoptions
.Effects:
Ifexists(to) &&
!(options & (copy_options::skip_existing | copy_options::overwrite_existing | copy_options::update_existing))
report a file already exists error as specified in Error reporting (7).
If!exists(to) || (options & copy_options::overwrite_existing) || ((options & copy_options::update_existing) && last_write_time(from) > last_write_time(to)) || !(options & (copy_options::skip_existing | copy_options::overwrite_existing | copy_options::update_existing))
copy the contents and attributes of the filefrom
resolves to the fileto
resolves to.Report a file already exists error as specified in Error reporting (7) if:
exists(to)
andequivalent(from, to)
, orexists(to)
and(options & (copy_options::skip_existing | copy_options::overwrite_existing | copy_options::update_existing)) == copy_options::none.
Otherwise copy the contents and attributes of the file
from
resolves to to the fileto
resolves to if:
!exists(to)
, orexists(to)
and(options & copy_options::overwrite_existing) != copy_options::none
, orexists(to)
and(options & copy_options::update_existing) != copy_options::none
andfrom
is more recent thanto
, determined as if by use of thelast_write_time
function.Otherwise no effects.
Returns:
true
if thefrom
file was copied, otherwisefalse
. The signature with argumentec
returnfalse
if an error occurs.Throws: As specified in Error reporting (7).
Complexity: At most one direct or indirect invocation of
status(to)
.