-
Notifications
You must be signed in to change notification settings - Fork 932
Better Handle EPERM on Windows #1495
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
Better Handle EPERM on Windows #1495
Conversation
Use async `fs-extra` function for rename, which hooks into a `graceful-fs` implementation that can handle AV locked files on Windows. See https://github.com/isaacs/node-graceful-fs/blob/89dc1330dcd8fa218c5dff92a97d8792b7da6b12/polyfills.js#L96-L118 for details.
|
Hm, we already utilize graceful-fs in |
The special handling of rename on Win32 seems to only be applied to the async version of "rename". In the source linked above, I couldn't find any special handling of the sync version. |
| @@ -1,4 +1,4 @@ | |||
| import fs from 'fs'; | |||
| import fs from 'fs-extra'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we switch this back to fs then and keep the rest of the changes?
thymikee
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
|
One thing I may want to check is that graceful-fs patches the fs promises interface as well. |
|
I looked at the So, we could go back to |
|
Ugh. Let's please leave a comment on why we use |
|
Added |
Summary:
Use async
fs-extrafunction for rename, which hooks into agraceful-fsimplementation that can handle AV locked files on Windows. See https://github.com/isaacs/node-graceful-fs/blob/89dc1330dcd8fa218c5dff92a97d8792b7da6b12/polyfills.js#L96-L118 for details.Test Plan:
Existing test coverage.