BoettcherDasOriginal / LeoConsole

LeoConsole is a terminal with many features! It allows you to quickly and easily program smaller or larger console functions or use those of others. It is written in C# 10 under .NET 6
GNU General Public License v3.0
2 stars 0 forks source link

[Feature request] XDG-like trash bin #37

Open alexcoder04 opened 2 years ago

alexcoder04 commented 2 years ago

Description

LeoConsole now has a built-in trash command, which moves deleted files into a trash folder. However, this has some disadvantages: e. g. what if multiple files with the same name are deleted? Or if the user decides to restore the file? Or delete files from trash after certain amount of time?

That's why I would suggest a system similar to the XDG trash spec, or even the XDG trash standard itself (then the trash folder has to be $XDG_DATA_HOME/Trash) (https://specifications.freedesktop.org/trash-spec/trashspec-latest.html). In short, the trash folder structure then looks like this:

trash
 | - files
 |   | - deletedfolder
 |   |  | - ...
 |   | - animage.png
 |   | - animage_1.png
 | - info
 |   | - deletedfolder.trashinfo
 |   | - animage.png.trashinfo
 |   | - animage_1.png.trashinfo

The .trashinfo files look like this:

[Trash Info]
Path=/home/user/Pictures/2020/animage.png
DeletionDate=2022-06-04T14:31:28