-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
fs.copyFile with COPYFILE_FICLONE flag does not overwrite destination if it exists #27273
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
The latest version of libuv (#27241) is switching from the macOS native copyfile(3) implementation to the more Unix-like generic implementation (libuv/libuv#2233). Would it be possible to test if the behavior still exists with the changed implementation? cc @nodejs/libuv |
I can confirm that #27241 solves the issue. |
MylesBorins
pushed a commit
to MylesBorins/node
that referenced
this issue
May 20, 2019
Notable changes: - uv_gettimeofday() has been added. - Streaming readdir() via the uv_fs_{open,read,close}dir() methods. - A macOS copyfile() permissions bug has been fixed. - A bug in uv_interface_addresses() on machines with multiple interfaces has been fixed. Fixes: nodejs#27273 PR-URL: nodejs#27241 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
MylesBorins
pushed a commit
that referenced
this issue
May 21, 2019
Notable changes: - uv_gettimeofday() has been added. - Streaming readdir() via the uv_fs_{open,read,close}dir() methods. - A macOS copyfile() permissions bug has been fixed. - A bug in uv_interface_addresses() on machines with multiple interfaces has been fixed. Fixes: #27273 Backport-PR-URL: #27776 PR-URL: #27241 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
According to https://github.com/nodejs/node/blob/master/doc/api/fs.md#fscopyfilesrc-dest-flags-callback the default behaviour of
fs.copyFile
is to overwrite the destination if it already exists. The documentation further gives the example of usingfs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE
to create a copy-on-write reflink which fails if the destination exists.The text was updated successfully, but these errors were encountered: