I did some more research for file deletions.
Iâm going to mark files for deletion in the DB, and then add an âempty trashâ button in the nav menu that will use this technique as a safeguard, along with a link that opens a page listing all the paths about to be unlinked.
Why this solution and not some of the other discussed options?
-
Moving files into a platform-specific âtrash canâ only works on local drives, and only on macOS and Windows. Linux support for trash is spotty, but I could ask users to install trash-cli. A âtrash canâ doesnât make sense for Docker users, as
~/.local/share/Trash/will be ephemeral to the image. -
I tend to be susceptible to âooooh, thatâs cleverâ solutions, which tend to be too clever by half. I feel like a hidden local directory may be confusing for most users, especially because I donât know of any software that does this sort of handling of deletions.
-
Moving files into a folder that you need to delete manually requires PhotoStructure to have a flawless view of volumes. It has a really good view of current volumes, but (especially on macOS) the APFS volume list is borked/shows duplicates that can be confusing. Loopback bind-mount folders, symlinks, and N other exotic filesystem constructs will get in the way of âwhat filesystem hosts this fileâ and âwhere should it go to delete itâ.
Related: