file

package
v2.6.1+incompatible Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// PrivateFileMode is the default permission for file
	PrivateFileMode = 0600

	// PrivateDirMode is the default permission for dir
	PrivateDirMode = 0700
)

Variables

View Source
var (
	// ErrLocked returns error when fail to get file lock.
	ErrLocked = errors.New("file: file already locked")
)

Functions

This section is empty.

Types

type LockedFile

type LockedFile struct{ *os.File }

LockedFile is a wrapper of file with lock logic.

func TryLockFile

func TryLockFile(path string, flag int, perm os.FileMode) (*LockedFile, error)

TryLockFile tries to open the file with a file lock.

Jump to

Keyboard shortcuts

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