Skip to content
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

Fix for EPERM on windows #24

Closed
wants to merge 1 commit into from
Closed

Conversation

mdlawson
Copy link

@mdlawson mdlawson commented Jul 7, 2013

A quick and kind of hacky fix for the EPERM errors that occur on windows (Most commonly for me involving deleting .git folders). This fixes #21

I've used chmodSync even in the async code, simply to avoid touching the existing structure, but this can be changed if desired.

chmod on windows only supports 444 and 666 which toggle read only.

@mdlawson mdlawson mentioned this pull request Jul 7, 2013
10 tasks
@paulmillr
Copy link
Contributor

@isaacs ping. quite a lot of people run into the bug constantly

@isaacs
Copy link
Owner

isaacs commented Jul 11, 2013

The problem with doing this is that it prevents you from actually making files read-only according to the Windows semantics.

Maybe only try this if you encounter an EPERM on Windows?

@mdlawson
Copy link
Author

@isaacs Not sure what you mean there:
a) The only time EPERM will be encountered (I'm guessing) is on read only files. If you deleted the same files from explorer, windows would have no issue with it. As such, the new behavior of deleting all files, read only or not, is in fitting with the windows "way".
b) Rimraf is trying to emulate rm -rf in a cross platform way, right? In unix, if I have a file owned by me, permissions 444, and run rm -rf, it will be deleted, no prompt. As such the new behavior is the same as the behavior in unix.

@paulmillr
Copy link
Contributor

I’ve done this in gh-26.

@isaacs
Copy link
Owner

isaacs commented Nov 29, 2013

Fixed by #26.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing EPERM removing read-only files on windows
3 participants