Skip to content
ConsoleMonster
Interface

ITrash

ConsoleMonster.FileSystem

Namespace
ConsoleMonster.FileSystem
Assembly
ConsoleMonster
Modifiers
abstract

Somewhere deleted files can be restored from: the Windows recycle bin, the macOS Trash or the freedesktop.org (XDG) trash on Linux. Delete operations use it; permanent deletion is a separate, explicit operation.

Usage

Explore 5 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Returned or exposed by 3

Accepted by parameters 2

Methods

public abstract string? MoveToTrash(string path) #

Moves a file or folder to the trash. It never deletes permanently in place of trashing.

Parameters

path string required
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.

Properties

public abstract string Name { get; } #

The name people know it by, such as Recycle Bin or Trash.

public abstract bool IsAvailable { get; } #

Whether this machine has a trash this process can use. When false, ITrash.MoveToTrash always fails.