-
Notifications
You must be signed in to change notification settings - Fork 774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
copySync(src, dst, {preserveTimestamps: true}) fails with EACCES when copying a directory contains read-only file on Linux #629
Comments
This actually happens on MacOS as well. A slightly simpler repro case:
|
This seems to be a problem with the ordering of |
It causes problems on Linux and macOS: jprichardson/node-fs-extra#629
I don't know. As reported by the OP, this issue is similar to #599 which was presumably fixed by #600. However, this might be fixed indirectly by the logic I added in #633 such as explicitly making the target file writable before setting the timestamps. This could have been the problem. Unfortunately I don't have a Linux box readily available but I can quickly test whether |
Cool thanks @mbargiel! I leave it open until we release |
I'm gonna close this out as fixed by #633; I dislike having open issues that already have PRs merged for them. We can reopen if it isn't fixed. |
jprichardson/node-fs-extra#629 Signed-off-by: Howard Hellyer <[email protected]>
fs-extra
version: 7.0.0Copying a directory using the recursive
copySync
function withpreserveTimestamps
option fails with permission error on Linux if the target is a directory contains read-only file.(This issue is similar to #599, but the problem still remains ever now)
Repro steps:
cp -pr root target
)target
directory is created andfile1
file, but notfile2
and the following is printed:The text was updated successfully, but these errors were encountered: