Send folder to Linux rubbish bin in C#

117 Views Asked by At

I use the FileOperationAPIWrapper that can be found here to move files to the recycle bin on Windows with great success. I'm looking for how to do the same on Linux in C#.

Perhaps the Linux trash is a static folder that I can simply move folders to?

1

There are 1 best solutions below

0
On

Putting a file or directory in the trash requires more than just moving the file to a specific directory. How the trash functionality is implemented on Linux is specified by FreeDesktop.org. It's important to create the metadata ".trashinfo" files otherwise file recovery from the trashcan won't work since the original location the file was deleted from is unknown.