tempfile

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2021 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Creator

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

Creator maintains the state of a pseudo-random number generator used to create temp files.

func NewCreator

func NewCreator() *Creator

NewCreator returns a new Creator, for creating temp files.

func (*Creator) Create

func (c *Creator) Create(eventualFile string) (*os.File, error)

Create attempts to create a temp file for eventualFile, and returns the corresponding *os.File and an error if any occurred. The temp file is created in the same directory as eventualFile, with permissions 0666 before the umask is applied.

Jump to

Keyboard shortcuts

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