system

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2016 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MS_PROPAGATION flags are special operations and cannot be combined
	// with each other or any flags other than MS_REC.
	MS_PROPAGATION = syscall.MS_SHARED | syscall.MS_SLAVE | syscall.MS_UNBINDABLE | syscall.MS_PRIVATE
	// MS_OPERATION flags can be mapped to high level operation names.
	MS_OPERATION = MS_PROPAGATION | syscall.MS_BIND | syscall.MS_MOVE | syscall.MS_REC
)

Variables

This section is empty.

Functions

func Bind

func Bind(source, target string) error

Bind creates a bind mount from source to target.

func CopyRegularFile

func CopyRegularFile(src, dest string) (err error)

CopyRegularFile copies a file in place, updates are not atomic. If the destination doesn't exist it will be created with the same permissions as the original but umask is respected. If the destination already exists the permissions will remain as-is.

func FullHostname

func FullHostname() string

FullHostname is a best effort attempt to resolve the canonical FQDN of the host. On failure it will fall back to a reasonable looking default such as 'localhost.' or 'hostname.invalid.'

func InstallRegularFile

func InstallRegularFile(src, dest string) error

InstallRegularFile copies a file, creating any parent directories.

func IsSymlink(path string) bool

IsSymlink checks if a path is a symbolic link.

func Mount

func Mount(source, target, fstype, options string) error

Mount wraps mount(2) in a similar way to mount(8), accepting both flags and filesystem options as a string. Any option not recognized as a flag will be passed as a filesystem option. Note that option parsing here is simpler than mount(8) and quotes are not considered.

func MountPrivate

func MountPrivate(target string) error

MountPrivate changes a mount point's propagation type to "private"

func MountShared

func MountShared(target string) error

MountShared changes a mount point's propagation type to "shared"

func MountSlave

func MountSlave(target string) error

MountSlave changes a mount point's propagation type to "slave"

func Move

func Move(source, target string) error

Move moves an entire tree under the source mountpoint to target.

func PortageArch

func PortageArch() string

func ReadOnlyBind

func ReadOnlyBind(source, target string) error

ReadOnlyBind creates a read-only bind mount. Note that this must be performed in two operations so it is possible for a read-write bind to be left behind if the second operation fails.

func RecursiveBind

func RecursiveBind(source, target string) error

RecursiveBind bind mounts an entire tree under source to target.

func RecursivePrivate

func RecursivePrivate(target string) error

RecursivePrivate changes an entire tree's propagation type to "private"

func RecursiveShared

func RecursiveShared(target string) error

RecursiveShared changes an entire tree's propagation type to "shared"

func RecursiveSlave

func RecursiveSlave(target string) error

RecursiveSlave changes an entire tree's propagation type to "slave"

Types

type MountError

type MountError struct {
	Source string
	Target string
	FsType string
	Flags  uintptr
	Extra  string
	Err    error
}

MountError records a mount operation failure, similar to os.PathError

func (*MountError) Error

func (e *MountError) Error() string

Directories

Path Synopsis
exec is extension of the standard os.exec package.
exec is extension of the standard os.exec package.
user is extension of the standard os.user package which supports groups.
user is extension of the standard os.user package which supports groups.

Jump to

Keyboard shortcuts

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