-
Notifications
You must be signed in to change notification settings - Fork 772
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
feature request: fs.softDelete or the like? #686
Comments
Yeah, https://github.com/sindresorhus/trash should be the package for that. If you're having issues with it, might try opening an issue there. Not sure if it's within scope for |
Maybe, but let's be fair: the whole reason we have fs-extra at all is because "[JP] got tired of including |
@jprichardson @manidlou @JPeer264 what's your opinions here? |
I am not completely sure but I feel like it is out of scope. For this, we probably need to have OS specific implementations. Also, I don't think we can achieve this without running some shell commands (if there is a way without using shell, I would love to know about it) and we all know that we don't deal with shell in this lib because of its security issues. |
what if you just wrap the https://github.com/sindresorhus/trash package, and expose its functions as part of |
The functions of trash are too few. We should need a nodejs global file permission, similar to |
@idler8 I'm not understanding what you're proposing? |
"being able to secure a directory" feels pretty out of scope for |
If I run this code at the beginning of the script |
I have an immature idea
|
Ah, I got your idea; basically a sandboxed filesystem. That's another whole level of complexity, and out of scope for fs-extra. Might make a great standalone package, though. |
Both Windows and MacOS has "safe" delete APIs for moving things to, respectively, the Recycle Bin and the Trash, from where files can be undeleted again - it would be super nice if
fs-extra
had a way to unlink files in a way that made them end up in those locations, rather than outright unlinking.And I honestly have no idea what a good name for that would be,
softDelete
is kind of weird, maybesafeUnlink
?trash
? (there is atrash
package already named that, so... maybe that? Though I couldn't get it to actually delete files to the recycle bin on the machine I tested it on)The text was updated successfully, but these errors were encountered: