Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenIsoImage ¶
GenIsoImage generates an ISO 9660 filesystem image containing files from srcDir. It uses specified volumeID as the volume id.
func GetFsStatsForPath ¶
GetFsStatsForPath returns the info about inode usage and space usage (in bytes) for the filesystem that contains the provided path.
Types ¶
type DelimitedReader ¶
type DelimitedReader interface { // ReadString returns next part of data up to (and including it) // the delimeter byte. ReadString(delim byte) (string, error) // Close closes the reader. Close() error }
DelimitedReader is an interface for reading a delimeter-separated data from files. It can be used for reading /sys and /proc information, for example.
type FileSystem ¶
type FileSystem interface { // Mount mounts the specified source under the target path. // For bind mounts, bind must be true. The bind mounts will // happen in the host mount namespace (that of PID 1). Mount(source string, target string, fstype string, bind bool) error // Unmount unmounts the specified target directory. If detach // is true, MNT_DETACH option is used (disconnect the // filesystem for the new accesses even if it's busy). Unmount(target string, detach bool) error // IsPathAnNs verifies if the path is a mountpoint with nsfs filesystem type. IsPathAnNs(string) bool // ChownForEmulator makes a file or directory owned by the emulator user. ChownForEmulator(filePath string, recursive bool) error // GetDelimitedReader returns a DelimitedReader for the specified path. GetDelimitedReader(path string) (DelimitedReader, error) // WriteFile creates a new file with the specified path or truncates // the existing one, setting the specified permissions and writing // the data to it. Returns an error if any occured // during the operation. WriteFile(path string, data []byte, perm os.FileMode) error }
FileSystem defines a filesystem interface interface
var NullFileSystem FileSystem = nullFileSystem{}
NullFileSystem is a fs that's used for testing and does nothing instead of mounting/unmounting.
var RealFileSystem FileSystem = &realFileSystem{}
RealFileSystem provides access to the real filesystem.
Click to show internal directories.
Click to hide internal directories.