You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In addition to deleting a file, it would be nice to be able to send it to the user's trash folder. The challenge in this one is that various OSes do things differently. Windows has the recycle bin, Linux has the trash folder (which can be in any number of places)
OSX holds it in ~/.Trash folder for main drive, other places for different mount points. Perhaps port the Trash application to C#.
Linus (and others using XDG spec) generally place it in .local/share/Trash, or mount-local directory.
Windows will probably use a PInvoke to native Win32 method since the Recycling Bin is a special GUID folder.
In case none of these work on the user's machine, need a good way to indicate failure. Perhaps by return value.
The text was updated successfully, but these errors were encountered:
For Mac/Linux it would probably be enough to just check for the existence of the expected folders and use it if it exists - it's unlikely you'll find a ~/.local/share/Trash directory on Mac, for example, so small risk of false positives. Your suggestion is another option - I do something similar in some of the test cases.
I would put it as a method on the IPath interface, since it interacts with the filesystem. It would then be added as an abstract method on ConcretePath (since the implementation varies by OS) and finally the implementation for each platform falls in the PosixPath and WindowsPath classes. No changes to anything "Pure".
In addition to deleting a file, it would be nice to be able to send it to the user's trash folder. The challenge in this one is that various OSes do things differently. Windows has the recycle bin, Linux has the trash folder (which can be in any number of places)
~/.Trash folder
for main drive, other places for different mount points. Perhaps port the Trash application to C#..local/share/Trash
, or mount-local directory.The text was updated successfully, but these errors were encountered: