safetemp

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2018 License: MPL-2.0 Imports: 4 Imported by: 13

README

go-safetemp

Godoc

Functions for safely working with temporary directories and files.

Why?

The Go standard library provides the excellent ioutil package for working with temporary directories and files. This library builds on top of that to provide safe abstractions above that.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dir

func Dir(dir, prefix string) (string, io.Closer, error)

Dir creates a new temporary directory that isn't yet created. This can be used with calls that expect a non-existent directory.

The directory is created as a child of a temporary directory created within the directory dir starting with prefix. The temporary directory returned is always named "temp". The parent directory has the specified prefix.

The returned io.Closer should be used to clean up the returned directory. This will properly remove the returned directory and any other temporary files created.

If an error is returned, the Closer does not need to be called (and will be nil).

Types

This section is empty.

Jump to

Keyboard shortcuts

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