Documentation
¶
Overview ¶
Package ostrash moves files to the system's trash, where the person can see, restore or empty them as any other deleted file (spec_029_files FIL-37a), and puts them back. On macOS it asks the system (NSFileManager's trashItemAtURL, through osascript, since Blitz is built without cgo), so Finder's Put Back works; on Linux and the BSDs it follows the freedesktop.org Trash specification. Elsewhere, and for a file the trash can't take, it says so (ErrUnavailable), and the caller keeps its own.
Index ¶
Constants ¶
This section is empty.
Variables ¶
ErrUnavailable is a trash this system doesn't have, or one that can't take the file (another disk than the home's, on Linux).
Functions ¶
func Available ¶
func Available() bool
Available reports whether this system has a trash Trash uses.
func Fake ¶
func Fake(dir string) (undo func())
Fake makes Trash move files into dir, as the system's trash would, until the returned func is called: for tests, which otherwise get no system trash at all (ErrUnavailable), so they never fill the person's.
Types ¶
This section is empty.