FileT.trash

Sends @file to the "Trashcan", if possible. This is similar to deleting it, but the user can recover it before emptying the trashcan. Not all file systems support trashing, so this call can return the %G_IO_ERROR_NOT_SUPPORTED error. Since GLib 2.66, the x-gvfs-notrash unix mount option can be used to disable g_file_trash() support for certain mounts, the %G_IO_ERROR_NOT_SUPPORTED error will be returned in that case.

If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.

template FileT(TStruct)
bool
trash
(
Cancellable cancellable
)

Parameters

cancellable Cancellable

optional #GCancellable object, %NULL to ignore

Return Value

Type: bool

%TRUE on successful trash, %FALSE otherwise.

Throws

GException on failure.

Meta