Documentation
¶
Index ¶
- func Chown(path string, user, group uint) (err error)
- func Copy(src, dst string, followSymlinks ...bool) (err error)
- func Copy2(src, dst string, followSymlinks ...bool) (err error)
- func CopyFile(src, dst string, followSymlinks ...bool) (err error)
- func CopyFileObj(fsrc, fdst *os.File, length ...int64) (err error)
- func CopyMode(src, dst string, followSymlinks ...bool) (err error)
- func CopyStat(src, dst string, followSymlinks ...bool) (err error)
- func CopyTree() (err error)
- func CopyTreeWithOpt() (err error)
- func GetTerminalSize(fallback ...winsize) (c, l int, err error)
- func IgnorePatterns(patterns ...string)
- func MakeArchive(opt *MakeOpt) (err error)
- func Move(srt, dst string) (err error)
- func RegisterArchiveFormat(name string, f func()) (err error)
- func RegisterUnpackFormat(name string, f func()) (err error)
- func RemoveDirContents(dir string, p ...string) (err error)
- func RmTree(dir string) (err error)
- func UnRegisterArchiveFormat(name string) (err error)
- func UnRegisterUnpackFormat(name string) (err error)
- func UnpackArchive(opt *UnpackOpt)
- func Which(cmd string, mode uint, path ...string) (p string, err error)
- type ArchiveFormat
- type Diskusage
- type DiskusageHuman
- type Error
- type ExecError
- type MakeOpt
- type ReadError
- type RegistryError
- type SameFileError
- type SpecialFileError
- type UnpackOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Copy2 ¶
Copy2 Copies the file src to the file or directory dst. also attempts to preserve file metadata
func CopyFile ¶
CopyFile Copy the contents (no metadata) of the file named src to a file named dst and return dst in the most efficient way possible.
func CopyFileObj ¶
CopyFileObj Copy the contents of the file-like object fsrc to the file-like object fdst.
func CopyStat ¶
CopyStat Copy the permission bits, last access time, last modification time, and flags from src to dst.
func CopyTree ¶
func CopyTree() (err error)
CopyTree Recursively copy an entire directory tree rooted at src to a directory named dst and return the destination directory.
func CopyTreeWithOpt ¶
func CopyTreeWithOpt() (err error)
CopyTreeWithOpt same to copytree,but can add extra opt-config
func GetTerminalSize ¶
GetTerminalSize Get the size of the terminal window.
func IgnorePatterns ¶
func IgnorePatterns(patterns ...string)
IgnorePatterns A factory function creates a function that can be used as a callable for copytree()’s ignore argument
func MakeArchive ¶
MakeArchive Create an archive file (such as zip or tar) and return its name.
func Move ¶
Move Recursively move a file or directory (src) to another location (dst) and return the destination.
func RegisterArchiveFormat ¶
RegisterArchiveFormat Register an archiver for the format name.
func RegisterUnpackFormat ¶
RegisterUnpackFormat Registers an unpack format.
func RemoveDirContents ¶
func RmTree ¶
RmTree Delete an entire directory tree; path must point to a directory (but not a symbolic link to a directory).
func UnRegisterArchiveFormat ¶
UnRegisterArchiveFormat Remove the archive format name from the list of supported formats.
func UnRegisterUnpackFormat ¶
UnRegisterUnpackFormat Unregister an unpack format. name is the name of the format.
func UnpackArchive ¶
func UnpackArchive(opt *UnpackOpt)
UnpackArchive Unpack an archive. filename is the full path of the archive.
Types ¶
type ArchiveFormat ¶
ArchiveFormat obj
func GetArchiveFormats ¶
func GetArchiveFormats() (afs []*ArchiveFormat)
GetArchiveFormats Return a list of supported formats for archiving
func GetUnpackFormats ¶
func GetUnpackFormats() (afs []*ArchiveFormat)
GetUnpackFormats Return a list of all registered formats for unpacking.
func (ArchiveFormat) String ¶
func (af ArchiveFormat) String() string
type Diskusage ¶
type Diskusage struct { Total uint64 // total size of the file system Used uint64 // total bytes used in file system Free uint64 // total free bytes on file system Available uint64 // total available bytes on file system to an unprivileged user Usage float32 //percentage of use on the file system }
func (Diskusage) ToHuman ¶
func (du Diskusage) ToHuman(unit ...string) DiskusageHuman
type DiskusageHuman ¶
type DiskusageHuman struct { Total string // total size of the file system Used string // total bytes used in file system Free string // total free bytes on file system Available string // total available bytes on file system to an unprivileged user Usage string //percentage of use on the file system }
type ExecError ¶
type ExecError struct {
Error
}
ExecError Raised when a command could not be executed
type MakeOpt ¶
type MakeOpt struct { Name string Format string RootDir string BaseDir string Verbose bool DryRun bool Owner int64 Group int64 Logger string }
MakeOpt obj
type RegistryError ¶
type RegistryError struct {
Error
}
RegistryError Raised when a registry operation with the archiving and unpacking registries fails
type SameFileError ¶
type SameFileError struct {
Error
}
SameFileError Raised when source and destination are the same file.
type SpecialFileError ¶
type SpecialFileError struct {
Error
}
SpecialFileError Raised when trying to do a kind of operation (e.g. copying) which is not supported on a special file (e.g. a named pipe)