tempdir

package
v1.25.0-dev Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2025 License: MIT Imports: 5 Imported by: 0

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
JackTT - Gopher 🇻🇳