3 ms·
Why not just use or alias ‘mv’ to trash?
by jasonlingx 4y ago
Why not just use or alias ‘mv’ to trash?
- Amine_Ztn 4y agoThis was my initial idea but unfortunately there can be name conflicts, if two files or folders have the same name, this idea does not work anymore. Also, I wanted to be able to keep the initial path to restore the element directly where it was deleted.
- imiric 4y agoHow would you use Rust with that approach?
- Amine_Ztn 4y agoWhen a person delete an item, I get all the information that are interesting for me (https://github.com/AmineZouitine/rmt.rs/blob/main/src/trash_item.rs https://github.com/AmineZouitine/rmt.rs/blob/main/src/trash_...), and then I move it in a .trash folder in which I rename it with a hash (the hash is made with several parameters to avoid any collision), I then store the information in a database sqlite :)