filesystem::copy()cannot copy symlinks
Section: 220.127.116.11 [fs.op.copy] Status: C++17 Submitter: Jonathan Wakely Opened: 2016-04-19 Last modified: 2017-07-30
View other active issues in [fs.op.copy].
View all other issues in [fs.op.copy].
View all issues with C++17 status.
18.104.22.168 [fs.op.copy] paragraph 3 bullet (3.4) says that if
copy_options is set in options then it should copy a symlink, but that
case cannot be reached.
is_symlink(f) can only be true if f was set using
symlink_status(from), but that doesn't happen unless one of
skip_symlinks is set in options. It should depend
I'm not sure what the correct behaviour is, but I don't think we
want to simply add a check for
copy_symlinks in bullet (3.1) because
that would mean that
t = symlink_status(to), and I don't think we want
'touch file; mkdir dir; ln -s dir link;' and then
t = symlink_status(to)
is_directory(t) == false, and we don't use bullet (3.5.4) but go
to (3.5.5) instead and fail. So when
copy_symlinks is set we still
need to use
t = status(to) as specified today.
[2016-05 Issues Telecon]
This is related to 2682; and should be considered together.
Wed AM: Move to Tentatively Ready
Modify paragraph 3 of 22.214.171.124 [fs.op.copy] as shown:
Effects: Before the first use of
(options & copy_options::create_symlinks) != copy_options::none || (options & copy_options::skip_symlinks) != copy_options::nonethen
auto f = symlink_status(from)and if needed
auto t = symlink_status(to).
auto f = status(from)and if needed
auto t = status(to).