Documentation
¶
Index ¶
- Constants
- Variables
- func CopyFile(src, dst string, isFirstDel ...bool) (err error)
- func Create(path string) (*os.File, error)
- func GetSize(path string) (int64, error)
- func HumanReadableSize(size int64) string
- func IsDir(filepath string) bool
- func IsExist(filepath string) bool
- func IsNotExist(filepath string) bool
- type FileTree
- type VisitFunc
- type VisitOrder
Constants ¶
View Source
const ( Byte int64 = 1 Kilobyte = 1024 * Byte Megabyte = 1024 * Kilobyte Gigabyte = 1024 * Megabyte Trillionbyte = 1024 * Gigabyte Petabyte = 1024 * Trillionbyte Exabyte = 1024 * Petabyte )
Variables ¶
View Source
var IsDirectory = IsDir
IsDirectory reports whether the named file is a directory.
View Source
var ( // PathSeparator can be used to override the operating system separator. PathSeparator = string(os.PathSeparator) )
Functions ¶
func HumanReadableSize ¶
func IsNotExist ¶
IsNotExist returns a boolean indicating whether a file or directory not exist.
Types ¶
type FileTree ¶
FileTree represents a directory in a filesystem-tree structure.
func (FileTree) AddDir ¶
AddDir adds a directory to a FileTree. If the path includes subdirectories they are created as necessary.
func (FileTree) AddFile ¶
AddFile adds a file to a FileTree. If the path includes subdirectories they are created as necessary.
type VisitFunc ¶
VisitFunc is the type for a callback to visit the entries on a directory and its subdirectories.
type VisitOrder ¶
type VisitOrder int8
VisitOrder is a two-valued flag used to control how directories are visited.
const ( // PreOrder has directories visited before their contents. PreOrder VisitOrder = iota // PostOrder has directories visited after their contents. PostOrder )
Click to show internal directories.
Click to hide internal directories.