Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

104
to-trash (tt) is a small, fast and hopefully FreeDesktop-compliant file trasher for Linux 🚮
Post Body

Repo: https://github.com/vrmiguel/to-trash

to-trash (tt for short) is a fast, small, and hopefully FreeDesktop-compliant file trasher for Linux (or other Unix-like systems which comply to this standard).

Usage

Usage: tt [files to be trashed]

Compliance

tt aims to have compliance with the FreeDesktop.org Trash specification.

Checked items below are what tt considers to be implemented, unchecked is anything that has no or partial implementation.

Some of those are my interpretation of the spec. and not necessarily verbatim to the specification text.

  • [x] Considers that the "home trash" is located at $XDG_DATA_HOME/Trash.
    • If XDG_DATA_HOME is not defined, falls back to ~/.local/share/Trash.
  • [x] Files that the user trashes from the same mount point as home are stored in the home trash.
  • [x] Trashed files are sent to $trash/files.
  • [x] An info file is created for every file being trashed.
    • [x] Contains a Path key with the absolute pathname of the original location of the file/directory
    • [x] Contains a DeletionDate key with the date and time when the file/directory was trashed in the YYYY-MM-DDThh:mm:ss format and in the user's local timezone.
  • [x] Create or update the $trash/directorysizes file, which is a cache of the sizes of the directories that were trashed into this trash directory.
    • [x] Each entry contains the name and size of the trashed directory, as well as the modification time of the corresponding trashinfo file
    • [x] The size is calculated as the disk space used by the directory and its contents.
    • [x] The directory name in the directorysizes must be percent-encoded.
    • [x] To update this file, a temporary file followed by an atomic rename() operation must be used in order to avoid corruption due to two implementations writing to the file at the same time.
    • [ ] Note: the implementation currently calculates the total size of the directory in bytes. I'm not sure if this is what the standard meant.
  • [x] If a $topdir/.Trash does not exist or has not passed the checks:
    • [x] If a $topdir/.Trash-$uid directory does not exist, the implementation must immediately create it, without any warnings or delays for the user.

tt is still quite a work in progress (no real CLI arg. parsing yet) and I intend to have more trash-related tools to have a fully functioning trashcan suite working, which is why I'd love to have some feedback from y'all!

Are there any features (or anything else) you'd recommend for this project?

Thanks in advance!

Author
Account Strength
100%
Account Age
10 years
Verified Email
Yes
Verified Flair
No
Total Karma
25,613
Link Karma
3,798
Comment Karma
21,568
Profile updated: 6 days ago
Posts updated: 3 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
3 years ago