1dfd95f0a0
The _wrename function won't overwrite an existing file, so use MoveFileEx instead. That allows renaming directories over files, which POSIX doesn't allow, so check for that case explicitly and report an error. Also document the deviation from the expected behaviour, and add a test for filesystem::rename which was previously missing. The Filesystem TS experimental::filesystem::rename doesn't have that extra code to handle directories correctly, so the relevant parts of the new test are not run on Windows. libstdc++-v3/ChangeLog: * doc/xml/manual/status_cxx2014.xml: Document implementation specific properties of std::experimental::filesystem::rename. * doc/xml/manual/status_cxx2017.xml: Document implementation specific properties of std::filesystem::rename. * doc/html/*: Regenerate. * src/c++17/fs_ops.cc (fs::rename): Implement correct behaviour for directories on Windows. * src/filesystem/ops-common.h (__gnu_posix::rename): Use MoveFileExW on Windows. * testsuite/27_io/filesystem/operations/rename.cc: New test. * testsuite/experimental/filesystem/operations/rename.cc: New test. |
||
---|---|---|
.. | ||
absolute.cc | ||
all.cc | ||
canonical.cc | ||
copy_file.cc | ||
copy.cc | ||
create_directories.cc | ||
create_directory.cc | ||
create_symlink.cc | ||
current_path.cc | ||
equivalent.cc | ||
exists.cc | ||
file_size.cc | ||
is_empty.cc | ||
last_write_time.cc | ||
permissions.cc | ||
proximate.cc | ||
read_symlink.cc | ||
relative.cc | ||
remove_all.cc | ||
remove.cc | ||
rename.cc | ||
resize_file.cc | ||
space.cc | ||
status.cc | ||
symlink_status.cc | ||
temp_directory_path.cc | ||
weakly_canonical.cc |