Title
copy_file() copies which attributes?
Status
new
Section
[fs.op.copy.file]
Submitter
Davis Herring

Created on 2018-01-26.00:00:00 last changed 83 months ago

Messages

Date: 2018-01-28.19:43:07

Proposed resolution:

This wording is relative to N4713.

  1. Modify [fs.op.copy.file] as indicated:

    Rationale:

    The attributes specified are the useful subset of the attributes that can be queried in C++17. Existing practice is complicated: POSIX "cp -p" attempts to preserve user/group IDs, for instance, but cannot in general do so, and setuid/setgid permissions may be stripped.

    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;
    

    […]

    1. […]

    2. (4.2) — Otherwise, copy the contents, permissions, and data modification time and attributes of the file from resolves to, to the file to resolves to, if:

    3. […]

      1. (4.2.3) — (options & copy_options::update_existing) != copy_options::none and from is more recent than to, determined as if by use of the last_write_time function ([fs.op.last.write.time]).

      Other implementation-defined attributes may be copied. Failure (or partial failure) to copy attributes is not an error.

    4. […]

    […]

Date: 2018-01-26.00:00:00

[ 2018-1-26 issues processing telecon ]

Priority 3

Date: 2018-01-26.00:00:00

(To resolve C++17 CD comment Late 25.) It is not stated which attributes are copied by copy_file().

History
Date User Action Args
2018-01-28 19:43:07adminsetmessages: + msg9658
2018-01-26 21:04:49adminsetmessages: + msg9644
2018-01-26 00:00:00admincreate