Class
XdgTrash
ConsoleMonster.FileSystem
The freedesktop.org trash used by Linux desktops (GNOME Files, Dolphin, gio trash): items move to Trash/files with a .trashinfo record in Trash/info, so file managers can restore them.
Inheritance
- object
- XdgTrash
Remarks
Items on the home volume go to $XDG_DATA_HOME/Trash (normally ~/.local/share/Trash). Items on another mounted volume go to that volume's .Trash/$uid or .Trash-$uid, as the specification asks, because a trash on another volume would turn a rename into a full copy.
Constructors
XdgTrash 2 overloads
Methods
public string? MoveToTrash(string path) #Moves a file or folder to the trash. It never deletes permanently in place of trashing.
Parameters
- path string
- The file or folder.
Returns
string? The item's location inside the trash when the platform reports it; otherwise null.Exceptions
IOException– The item could not be trashed; nothing was deleted.
Inherited Methods
Properties
public string Name { get; } #The name people know it by, such as Recycle Bin or Trash.
public bool IsAvailable { get; } #Whether this machine has a trash this process can use. When false, ITrash.MoveToTrash always fails.