tempdir

package
v1.24.5 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: MIT Imports: 5 Imported by: ? 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TempDir

type TempDir struct {
	// contains filtered or unexported fields
}

func New

func New(base, sub string) *TempDir

New create a new TempDir instance, "base" must be an existing directory, "sub" could be a multi-level directory and will be created if not exist

func OsTempDir

func OsTempDir(sub string) *TempDir

func (*TempDir) CreateTempFileRandom

func (td *TempDir) CreateTempFileRandom(elems ...string) (*os.File, func(), error)

CreateTempFileRandom works like os.CreateTemp, the last path field is the "pattern"

func (*TempDir) JoinPath

func (td *TempDir) JoinPath(elems ...string) string

func (*TempDir) MkdirAllSub

func (td *TempDir) MkdirAllSub(dir string) (string, error)

MkdirAllSub works like os.MkdirAll, but the base directory must exist

func (*TempDir) MkdirTempRandom

func (td *TempDir) MkdirTempRandom(elems ...string) (string, func(), error)

MkdirTempRandom works like os.MkdirTemp, the last path field is the "pattern"

func (*TempDir) RemoveOutdated

func (td *TempDir) RemoveOutdated(d time.Duration)

Jump to

Keyboard shortcuts

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