File.trash
bool trash(gio.cancellable.Cancellable cancellable = null)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 gio.types.IOErrorEnum.NotSupported error. Since GLib 2.66, the x-gvfs-notrash unix mount option can be used to disable gio.file.File.trash support for certain mounts, the gio.types.IOErrorEnum.NotSupported 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 gio.types.IOErrorEnum.Cancelled will be returned.
Parameters
cancellable | optional #GCancellable object, null to ignore |
Returns
true on successful trash, false otherwise.