-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
Trashing a file on Windows deletes it unrecoverably if no recycle bin is enabled #107
Comments
What do you think should happen? Throw an error in such case? Add an option for what to do? |
IMO it should ideally throw an error when it cannot trash the file, because the reason why I use this library, is so that the user doesn't lose their file immediately. If |
I agree. It should be a custom Continued in sindresorhus/recycle-bin#8. |
I want to use this package as a fallback for Electron's The electron function is able to detect the errors somehow avoid the deletion. Edit: They have switched to |
I see the reasoning here, but it conflicts with a use case where Windows user can configure their Recycle bin to delete files immediately. In this scenario deleting files instead of moving them to trash is what the user wants, and throwing errors here would be wrong. So unless you can check that file is being deleted from a drive that doesn't have immediate deletion enabled, you shouldn't throw errors. |
Similar to #56, but probably has to be solved in a different way for Windows.
This was reported by a user in my app losslesscut mifi/lossless-cut#537
When he trashed a file on a network mounted drive (which has no trash), the file just got removed permanently.
The text was updated successfully, but these errors were encountered: