[bash] Replace "trash" directory with "undeletable" filesystem flag #170

Open
opened 2026-06-12 07:32:39 +02:00 by vlw · 0 comments
vlw commented 2026-06-12 07:32:39 +02:00 (Migrated from codeberg.org)

I'm not sure this will work as expected, but we should investigate if the "Undeletable" flag can be used instead of moving files into the $TRASH_DIR directory. This would have two main benefits: No file conflicts in the trash directory (although this is arguably an easy fix), and most importantly we can trash files on other disks without moving them to the trash directory in $HOME (default).

We need to investigate if we need to maintain our own record of which files have been deleted, or if ext4 will handle that for us. We also need to investigate if ext4 can list files with this attribute set. We don't want untracked "deleted" files lingering if something goes wrong.

https://en.wikipedia.org/wiki/Chattr#Attributes

I'm not sure this will work as expected, but we should investigate if the "Undeletable" flag can be used instead of moving files into the `$TRASH_DIR` directory. This would have two main benefits: No file conflicts in the trash directory (although this is arguably an easy fix), and most importantly we can trash files on other disks without moving them to the trash directory in `$HOME` (default). We need to investigate if we need to maintain our own record of which files have been deleted, or if ext4 will handle that for us. We also need to investigate if ext4 can list files with this attribute set. We don't want untracked "deleted" files lingering if something goes wrong. https://en.wikipedia.org/wiki/Chattr#Attributes
Sign in to join this conversation.
No labels
bug
feature
refactor
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
vlw/dotfiles#170
No description provided.