Documentation
¶
Overview ¶
Package tmpclean keeps the temporary files and folders this komando run made (a download before its rename, a sign-in browser profile, a database CA copy), so a hard stop still removes them. Each one is removed by its own code when it is done; the list is for the second Ctrl-C (or SIGTERM, SIGHUP), which ends komando without running that code. Old leftovers of a run that was killed outright (SIGKILL, a power cut) are swept by Sweep where such files are made.
Index ¶
Constants ¶
const Stale = 24 * time.Hour
Stale is how old a leftover must be before Sweep removes it: a run that is still going (a slow sign-in, a long download) is never that old.
Variables ¶
This section is empty.
Functions ¶
func Add ¶
func Add(path string) (forget func())
Add keeps path (a file or a folder) on the list. The returned forget takes it off: call it once the path is removed or renamed into place.
func Sweep ¶
func Sweep(dir, prefix, suffix string)
Sweep removes what earlier runs left in dir: names that start with prefix and end with suffix, owned by this user (a folder anyone can write to, like /tmp, holds other users' files too), changed more than Stale ago. Links are removed, never followed.
Types ¶
This section is empty.