filesystem

package
v0.0.0-...-288c4de Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FilesystemSuperMagicZfs = 0x2fc12fc1
)

Filesystem magic numbers.

Variables

This section is empty.

Functions

func Detect

func Detect(path string) (string, error)

Detect returns the filesystem on which the passed-in path sits.

func FSTypeToName

func FSTypeToName(fsType int32) (string, error)

FSTypeToName returns the name of the given fs type. The fsType is from the Type field of unix.Statfs_t. We use int32 so that this function behaves the same on both 32bit and 64bit platforms by requiring any 64bit FS types to be overflowed before being passed in. They will then be compared with equally overflowed FS type constant values.

func IsMountPoint

func IsMountPoint(path string) bool

IsMountPoint returns true if path is a mount point.

func PathNameDecode

func PathNameDecode(text string) string

PathNameDecode decodes a string containing an encoded path back to its original form. The decoding scheme converts "-" back to "/" and "--" back to "-".

func PathNameEncode

func PathNameEncode(text string) string

PathNameEncode encodes a path string to be used as part of a file name. The encoding scheme replaces "-" with "--" and then "/" with "-".

func ResolveMountOptions

func ResolveMountOptions(options []string) (uintptr, string)

ResolveMountOptions resolves the provided mount options.

func StatVFS

func StatVFS(path string) (*unix.Statfs_t, error)

StatVFS retrieves Virtual File System (VFS) info about a path.

func SyncFS

func SyncFS(path string) error

SyncFS will force a filesystem sync for the filesystem backing the provided path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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