Documentation ¶
Overview ¶
Package remove_trash exports the Traverse function, which traverses a path and removes all trash files and folders in it, reporting progress and calculating the size freed by the operation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Version string
Functions ¶
This section is empty.
Types ¶
type FailedPath ¶
Instead of throwing an error and stopping, the errors are collected and returned at the end. This represents files/folders which could not be deleted by os.RemoveAll
func Traverse ¶
func Traverse(path string, dryRun bool, pr chan<- ProgressReport) ([]string, []FailedPath, error)
Traverses path, returning a list of files/folders that were removed. If dryRun is true, do not remove any file. pr is called to report progress.
type ProgressReport ¶
The type of the function that is called to report progress. The arguments are, in order, the current count, the current total and the number of bytes freed by this operation (that is, so far). The total can and does change as files are discovered.