{"modulePath":"github.com/hyperhq/hypercli","version":"v1.10.16","isLatest":true,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package system\n\n## Constants\n\n```go\nconst DefaultPathEnv = \"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\n```\nDefaultPathEnv is unix style list of directories to search for executables. Each directory is separated from the next by a colon ':' character .\n\n## Variables\n\n```go\nvar (\n\t// ErrNotSupportedPlatform means the platform is not supported.\n\tErrNotSupportedPlatform = errors.New(\"platform and architecture is not supported\")\n)\n```\n\n## Functions\n\n```go\nfunc Chtimes(name string, atime time.Time, mtime time.Time) error\n```\nChtimes changes the access time and modified time of a file at the given path\n\n```go\nfunc IsAbs(path string) bool\n```\nIsAbs is a platform-specific wrapper for filepath.IsAbs.\n\n```go\nfunc LUtimesNano(path string, ts []syscall.Timespec) error\n```\nLUtimesNano is used to change access and modification time of the specified path. It's used for symbol link file because syscall.UtimesNano doesn't support a NOFOLLOW flag atm.\n\n```go\nfunc Lgetxattr(path string, attr string) ([]byte, error)\n```\nLgetxattr retrieves the value of the extended attribute identified by attr and associated with the given path in the file system. It will returns a nil slice and nil error if the xattr is not set.\n\n```go\nfunc Lsetxattr(path string, attr string, data []byte, flags int) error\n```\nLsetxattr sets the value of the extended attribute identified by attr and associated with the given path in the file system.\n\n```go\nfunc Mkdev(major int64, minor int64) uint32\n```\nMkdev is used to build the value of linux devices (in /dev/) which specifies major and minor number of the newly created device special file. Linux device nodes are a bit weird due to backwards compat with 16 bit device nodes. They are, from low to high: the lower 8 bits of the minor, then 12 bits of the major, then the top 12 bits of the minor.\n\n```go\nfunc MkdirAll(path string, perm os.FileMode) error\n```\nMkdirAll creates a directory named path along with any necessary parents, with permission specified by attribute perm for all dir created.\n\n```go\nfunc Mknod(path string, mode uint32, dev int) error\n```\nMknod creates a filesystem node (file, device special file or named pipe) named path with attributes specified by mode and dev.\n\n```go\nfunc Umask(newmask int) (oldmask int, err error)\n```\nUmask sets current process's file mode creation mask to newmask and return oldmask.\n\n```go\nfunc Unmount(dest string) error\n```\nUnmount is a platform-specific helper function to call the unmount syscall.\n\n## Types\n\n```go\ntype MemInfo struct {\n\t// Total usable RAM (i.e. physical RAM minus a few reserved bits and the\n\t// kernel binary code).\n\tMemTotal int64\n\n\t// Amount of free memory.\n\tMemFree int64\n\n\t// Total amount of swap space available.\n\tSwapTotal int64\n\n\t// Amount of swap space that is currently unused.\n\tSwapFree int64\n}\n```\nMemInfo contains memory statistics of the host system.\n\n```go\nfunc ReadMemInfo() (*MemInfo, error)\n```\nReadMemInfo retrieves memory statistics of the host system and returns a\n\n\tMemInfo type.\n\n```go\ntype StatT struct {\n\t// contains filtered or unexported fields\n}\n```\nStatT type contains status of a file. It contains metadata like permission, owner, group, size, etc about a file.\n\n```go\nfunc FromStatT(s *syscall.Stat_t) (*StatT, error)\n```\nFromStatT exists only on linux, and loads a system.StatT from a syscal.Stat\\_t.\n\n```go\nfunc Lstat(path string) (*StatT, error)\n```\nLstat takes a path to a file and returns a system.StatT type pertaining to that file.\n\nThrows an error if the file does not exist\n\n```go\nfunc Stat(path string) (*StatT, error)\n```\nStat takes a path to a file and returns a system.StatT type pertaining to that file.\n\nThrows an error if the file does not exist\n\n```go\nfunc (s StatT) GID() uint32\n```\nGID returns file's group id of owner.\n\n```go\nfunc (s StatT) GetLastModification() syscall.Timespec\n```\nGetLastModification returns file's last modification time.\n\n```go\nfunc (s StatT) Mode() uint32\n```\nMode returns file's permission mode.\n\n```go\nfunc (s StatT) Mtim() syscall.Timespec\n```\nMtim returns file's last modification time.\n\n```go\nfunc (s StatT) Rdev() uint64\n```\nRdev returns file's device ID (if it's special file).\n\n```go\nfunc (s StatT) Size() int64\n```\nSize returns file's size.\n\n```go\nfunc (s StatT) UID() uint32\n```\nUID returns file's user id of owner.\n\n","path":"github.com/hyperhq/hypercli/pkg/system","name":"system","synopsis":"","isRedistributable":true}
