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.
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
.
- If
- [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 theYYYY-MM-DDThh:mm:ss
format and in the user's local timezone.
- [x] Contains a
- [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.
- [x] If a
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!
Subreddit
Post Details
- Posted
- 3 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/rust/commen...