Title
LWG 2935 forgot to fix the existing_p overloads of create_directory
Status
c++20
Section
[fs.op.create.directory]
Submitter
Billy O'Neal III

Created on 2018-03-07.00:00:00 last changed 45 months ago

Messages

Date: 2018-06-12.01:05:16

Proposed resolution:

This wording is relative to N4727.

  1. Edit [fs.op.create_directory] as indicated:

    bool create_directory(const path& p, const path& existing_p);
    bool create_directory(const path& p, const path& existing_p, error_code& ec) noexcept;
    

    -4- Effects: Establishes the postcondition by attempting to createCreates the directory p resolves to, with attributes copied from directory existing_p. The set of attributes copied is operating system dependent. Creation failure because p resolves to an existing directory shall not be treated asalready exists is not an error. [Note: For POSIX-based operating systems, the attributes are those copied by native API stat(existing_p.c_str(), &attributes_stat) followed by mkdir(p.c_str(), attributes_stat.st_mode). For Windows-based operating systems, the attributes are those copied by native API CreateDirectoryExW(existing_p.c_str(), p.c_str(), 0). — end note]

    -5- Postconditions: is_directory(p).

    […]

Date: 2018-06-12.01:05:16

[ 2018-06 Rapperswil: Adopted ]

Date: 2018-03-27.00:00:00

[ 2018-03-27 Moved to Tentatively Ready after 6 positive votes on c++std-lib. ]

Date: 2018-03-07.00:00:00

LWG 2935 clarified that create_directory is not supposed to report an error if exists(p), even if p is not a directory. However, the P/R there missed the existing_p overloads.

History
Date User Action Args
2021-02-25 10:48:01adminsetstatus: wp -> c++20
2018-06-12 01:05:16adminsetmessages: + msg9887
2018-06-12 01:05:16adminsetstatus: voting -> wp
2018-05-06 19:23:13adminsetstatus: ready -> voting
2018-03-31 12:07:05adminsetmessages: + msg9793
2018-03-31 12:07:05adminsetstatus: new -> ready
2018-03-24 20:08:17adminsetmessages: + msg9767
2018-03-07 00:00:00admincreate