tmpclean

package
v0.14.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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 Kept

func Kept() int

Kept is how many paths are on the list (tests).

func RemoveAll

func RemoveAll()

RemoveAll removes every path on the list and empties it.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL