Documentation ¶
Index ¶
- Constants
- func Bind(source, target string) error
- func CopyRegularFile(src, dest string) (err error)
- func FullHostname() string
- func InstallRegularFile(src, dest string) error
- func IsSymlink(path string) bool
- func Mount(source, target, fstype, options string) error
- func MountPrivate(target string) error
- func MountShared(target string) error
- func MountSlave(target string) error
- func Move(source, target string) error
- func PortageArch() string
- func ReadOnlyBind(source, target string) error
- func RecursiveBind(source, target string) error
- func RecursivePrivate(target string) error
- func RecursiveShared(target string) error
- func RecursiveSlave(target string) error
- type MountError
Constants ¶
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 CopyRegularFile ¶
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 ¶
InstallRegularFile copies a file, creating any parent directories.
func Mount ¶
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 ¶
MountPrivate changes a mount point's propagation type to "private"
func MountShared ¶
MountShared changes a mount point's propagation type to "shared"
func MountSlave ¶
MountSlave changes a mount point's propagation type to "slave"
func PortageArch ¶
func PortageArch() string
func ReadOnlyBind ¶
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 ¶
RecursiveBind bind mounts an entire tree under source to target.
func RecursivePrivate ¶
RecursivePrivate changes an entire tree's propagation type to "private"
func RecursiveShared ¶
RecursiveShared changes an entire tree's propagation type to "shared"
func RecursiveSlave ¶
RecursiveSlave changes an entire tree's propagation type to "slave"