lxtempdir

package module
v0.0.0-...-e8f0a4e Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2019 License: MIT Imports: 4 Imported by: 0

README

go-lxtempdir

Safe temporary directories on Linux according to the systemd guide.

Docs here.

Documentation

Overview

Package lxtempdir provides safe temporary directories for Linux.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TempDir

type TempDir struct {
	// The path to the temporary directory.
	Path string
	// contains filtered or unexported fields
}

TempDir represents a temporary directory that you have access to. systemd-tmpfiles will *not* clean up the directory until the program dies or Close is called.

func Create

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

Create creates a new temporary directory. The arguments have identical meaning to ioutil.TempDir.

func (*TempDir) Close

func (tempdir *TempDir) Close() error

Close relinquishes access to tempdir. After this function is called, systemd-tmpfiles is free to clean up the temporary directory, even if your program is still running.

This does not remove the directory and its contents; use os.RemoveAll first to do that.

Jump to

Keyboard shortcuts

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