This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++20 status.
!is_regular_file(from)
cause copy_file
to report a "file already exists" error?Section: 31.12.13.5 [fs.op.copy.file] Status: C++20 Submitter: Tim Song Opened: 2016-12-17 Last modified: 2021-06-06
Priority: 2
View all other issues in [fs.op.copy.file].
View all issues with C++20 status.
Discussion:
[fs.op.copy_file]/4 says that copy_file
reports "a file already exists error as specified in
[fs.err.report] if" any of several error conditions exist.
!is_regular_file(from)
, can be sensibly described
as "file already exists". Pretty much everywhere else in the filesystem specification just says "an error" without
further elaboration.
[2017-01-27 Telecon]
Priority 2; Jonathan to provide updated wording.
[2018-01-16, Jonathan comments]
I said I'd provide updated wording because I wanted to preserve the requirement that the reported error is "file already exists" for some of the error cases. I no longer think that's necessary, so I think the current P/R is fine. Please note that I don't think new wording is needed.
[ 2018-01-23 Moved to Tentatively Ready after 6 positive votes on c++std-lib. ]
[2018-3-17 Adopted in Jacksonville]
Proposed resolution:
This wording is relative to N4713.
Edit [fs.op.copy_file]/4 as indicated:
bool copy_file(const path& from, const path& to, copy_options options); bool copy_file(const path& from, const path& to, copy_options options, error_code& ec) noexcept;-4- Effects: As follows:
(4.1) — Report
a file already existsan error as specified in 31.12.5 [fs.err.report] if:
(4.1.1) —[…]
(4.2) —[…]