temp

package
v0.0.0-...-764741f Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package temp makes hierarchical temporary directories it offers the same interface as ioutil, but recursive. The more you use this to create temporary directories, the fewer places we need to change when we want to relocate all our tempfiles.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Module

func Module() ice.Module

Module returns a Module that will use a TempDir in $TMPDIR

Types

type TempDir

type TempDir struct {
	Dir string
}

TempDir is a temporary directory, that may live under other temporary directories.

func NewTempDir

func NewTempDir(dir, prefix string) (*TempDir, error)

Create a new TempDir in directory dir with prefix string.

func TempDirDefault

func TempDirDefault() (*TempDir, error)

TempDirDefault creates a TempDir rooted in the default temp dir

func TempDirHere

func TempDirHere() (*TempDir, error)

TempDirHere creates a TempDir rooted in our current working directory Side effect: sets environment variable TMPDIR

func (*TempDir) FixedDir

func (d *TempDir) FixedDir(name string) (*TempDir, error)

Create a new directory with a fixed name (this lets us structure our temp files)

func (*TempDir) TempDir

func (d *TempDir) TempDir(prefix string) (*TempDir, error)

Create a new temporary directory under d

func (*TempDir) TempFile

func (d *TempDir) TempFile(prefix string) (*os.File, error)

Create a new temporary file under d

Jump to

Keyboard shortcuts

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