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

Changed pwd when running app otherwise folder is locked by spawn process, removing files and folders recursively as root folder may be locked and unable to delete. #105

Closed
wants to merge 2 commits into from

Conversation

Mior
Copy link

@Mior Mior commented Mar 10, 2016

  • changed delete implementation to not remove root directory as it may be opened (when clicked on nw.exe and kept explorer open) within some program like windows explorer and thus locked. -> it throws error and cannot update
  • added run options "cwd" to change working directory to new one as old will be deleted and spawned process will keep lock on folder.

… may be opened within some program like windows explorer and thus locked. -> it throws error and cannot update

+ added run options "cwd" to change working directory to new one as old will be deleted and spawned process will keep lock on folder.
@adam-lynch
Copy link
Collaborator

First, thanks for the PR.

Is this a problem we can't solve with del? I'd be surprised since del is so popular.

@Mior
Copy link
Author

Mior commented Mar 12, 2016

Adam you are right on this we could use del but we need to include /** to to argument.
del(to + '/**', {force: true}, cb);

Would you prefer this approach?

- found that 'cwd' is causing issues and is not needed
@adam-lynch
Copy link
Collaborator

Thanks for this. Sorry for being slow getting back to you. I will have to do some cautious manual tests.

@jasminmif
Copy link

Im facing same problem Error: EBUSY: resource busy or locked, rmdir 'C:\Users\...' at Error (native) , with the del(to + '/**', {force: true}, cb);, and the folder is not opened nor its opened in text editor or smth. did you find any possible fix ? or the code above works for you ?

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.

4 participants