Show HN: Rmt an alternative to rm with trash written in Rust
github.com
github.com
> Launch CLI to restore or flush elements: `rmt trash_display` or `rmt td`
> Flush all element from the trash: `rmt trash_flush`
Those need to be dash-style options. Because if someone runs a `rmt *` in a directory and there's a trash_flush file inside, it will NOT do what one expects and will be destructive.
This is why options are traditionally prefixed with dashes. (Yeah sure, you have the same problem if you have a file that starts with dash, I already hear someone point out.)
Since you suggest to alias rm to rmt, your application needs to behave like rm and have a similar UI.
rm -- --file-that-looks-like-a-flag rm ./--file-that-looks-like-a-flag
;)(I'm always half-tempted to suggest that a "strict mode" shell should require all paths in arguments to start with either / or ./ so that anything else is unambiguously not a file.)
(I spent a bunch of time with a file named -i in my home directory, you know, just in case.)
I thank you for raising these points.
Rmt is a program used by the remote dump(8), restore(8) or tar(1)
programs in manipulating a magnetic tape drive through an
interprocess communication connection. Rmt is normally started up
with an rexec(3) or rcmd(3) call.
The rmt program accepts requests specific to the manipulation of
magnetic tapes, performs the commands, then responds with a
status indication. All responses are in ASCII and in one of the
following two forms.
Depending on the platform, this could cause a name collision with unexpected results.Not telling you what to do, just that you should be aware.
> ln -s important_file.txt ./just_a_link
> rmt ./just_a_link
This leaves "just_a_link" and instead deletes important_file.txt.`rip` seems unmaintained (three open PRs from one to five years old). It has a name that doesn't clash with an existing *nix command and people seem to also ask for the same thing since its inception (see issue #3 from 2016).
I even had to disable rm for non-privileged users on my systems just to get used to use trash-cli.
Just last night I rimraf'd something and did a double take. I deleted the right one, thankfully, but you're always one command from trouble.
https://github.com/bAndie91/libyazzy-preload/#recyclixso
recyclix.so is an LD_PRELOAD-able shared library intercepting file deletions and moving files to recycle bin (trash can) folder.
https://specifications.freedesktop.org/trash-spec/trashspec-...
The main one is that files sent to trash are encrypted. So that a private key is required to restore them.
Ideally even the meta data is encrypted.
I've watched too many kids spy movies from the 2010s with files restored from trash!
Edit: just wanted to add I just mean via GPG! Rather than asking encryption be added to the application.