This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/70609] std::experimental::filesystem::copy fails if the file size is 0 bytes
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 19 Apr 2016 18:03:11 +0000
- Subject: [Bug libstdc++/70609] std::experimental::filesystem::copy fails if the file size is 0 bytes
- Auto-submitted: auto-generated
- References: <bug-70609-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70609
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Author: redi
Date: Tue Apr 19 18:02:39 2016
New Revision: 235215
URL: https://gcc.gnu.org/viewcvs?rev=235215&root=gcc&view=rev
Log:
libstdc++/70609 fix filesystem::copy()
PR libstdc++/70609
* src/filesystem/ops.cc (close_fd): New function.
(do_copy_file): Set permissions before copying file contents. Check
result of closing file descriptors. Don't copy streambuf when file
is empty.
(copy(const path&, const path&, copy_options, error_code&)): Use
lstat for source file when copy_symlinks is set.
* testsuite/experimental/filesystem/operations/copy.cc: Test copy().
Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/src/filesystem/ops.cc
trunk/libstdc++-v3/testsuite/experimental/filesystem/operations/copy.cc