Trash can operations implemented in D programming language. The moveToTrash function places a passed file or directory to trash can. The Trashcan class allows to list trashcan contents, restore or delete items.
On Freedesktop environments (e.g. GNU/Linux) the library follows Trash Can Specification.
On Windows SHFileOperation is used to move files to trash, and IShellFolder2 is used as an interface to recycle bin to list, delete and undelete items.
On OSX FSMoveObjectToTrashSync is used to move files to trash. Listing, deleting and undeleting items in the trash can are not currently supported on macOS.
Other platforms are not supported.
- Notifying changes in trash can contents (or at least providing the data required to implement this feature for the library user).
Run to put file or directory to trash can:
dub examples/put.d path/to/file
Interactively delete items from trashcan or restore them to their original location.
dub examples/manage.d