trashcan 0.3.0

Move files to trash can (aka recycle bin) programmatically


To use this package, run the following command in your project's root directory:

Trash can

Build Status Windows Build Status

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.

Online documentation

Platform support and implementation details

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.

Currently missing features

  • Notifying changes in trash can contents (or at least providing the data required to implement this feature for the library user).

Examples

Put to trash can

Run to put file or directory to trash can:

dub examples/put.d path/to/file

Manage items in trash can

Interactively delete items from trashcan or restore them to their original location.

dub examples/manage.d
Authors:
  • Roman Chistokhodov
Dependencies:
xdgpaths, inilike, volumeinfo
Versions:
0.3.0 2020-Sep-23
0.2.4 2018-May-05
0.2.3 2018-Feb-13
0.2.2 2017-Mar-28
0.2.1 2016-Sep-26
Show all 8 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 3 downloads this month

  • 169 downloads total

Score:
0.0
Short URL:
trashcan.dub.pm