trash

open fun trash(cancellable: Cancellable? = null): <Error class: unknown class><Boolean>

Sends @file to the "Trashcan", if possible. This is similar to deleting it, but the user can recover it before emptying the trashcan. Trashing is disabled for system mounts by default (see g_unix_mount_is_system_internal()), 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 particular mounts, the %G_IO_ERROR_NOT_SUPPORTED error will be returned in that case. Since 2.82, the x-gvfs-trash unix mount option can be used to enable g_file_trash() support for particular system mounts.

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.

Return

true on successful trash, false otherwise.

Parameters

cancellable

optional #GCancellable object, null to ignore