sync

package
v0.0.0-...-923e5ac Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2018 License: GPL-3.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ERROR_BAD_FILE_DESCRIPTOR = errors.New("bad file descriptor!")
View Source
var ERROR_MUTUALLY_EXCLUSIVE_OPTIONS = errors.New("options data, file & filesystem are mutually exclusive!")

Functions

func MutuallyExclusiveBoolError

func MutuallyExclusiveBoolError(inputE error, values ...bool) (bool, error)

returns true and the given error, if more then one value is true

func Sync

func Sync(input *Input) (exitCode uint8)

Synchronize all filesystems or a file.

func Synchronize

func Synchronize(input *Input, output abstract.OutputInterface) (exitCode uint8)

Synchronize all filesystems or a file.

According to the standard specification (e.g., POSIX.1-2001), sync() schedules the writes, but may return before the actual writing is done. However Linux waits for I/O completions, and thus sync() or syncfs() provide the same guarantees as fsync called on every file in the system or filesystem respectively.

Types

type Input

type Input struct {
	abstract.Input

	PathList []string

	// sync only file data, no unneeded metadata
	Data bool

	// sync file
	File bool

	// [not implemented] sync the file systems that contain the files
	FileSystem bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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