# README
fs - A FileSystem Abstraction System for Go
Installation
To install the package, run:
go get github.com/go-zoox/fs
Getting Started
f := fs.OpenFile("/path/to/file")
List of all available functions
// go doc
func BaseName(path string) string
func Chmod(name string, mode os.FileMode) error
func Chown(name string, uid, gid int) error
func Copy(srcPath, dstPath string) error
func CopyDir(srcPath string, dstPath string) error
func CopyFile(srcPath string, dstPath string) error
func CreateDir(path string) error
func CreateFile(path string) error
func CreateSymbolicLink(srcPath, dstPath string) error
func DirName(path string) string
func ExtName(path string) string
func IsAbsPath(path string) bool
func IsDir(path string) bool
func IsEmpty(path string) bool
func IsExist(path string) bool
func IsFile(path string) bool
func IsSymbolicLink(path string) bool
func JoinPath(paths ...string) string
func ListDir(path string) ([]iofs.FileInfo, error)
func Mkdir(path string) error
func Mkdirp(path string) error
func Move(srcPath, dstPath string) error
func MoveDir(srcPath string, dstPath string) error
func MoveFile(srcPath, dstPath string) error
func Open(path string) (*os.File, error)
func OpenFile(path string) (*os.File, error)
func ReadFile(srcPath string) ([]byte, error)
func ReadFileAsString(srcPath string) (string, error)
func ReadFileLines(srcPath string) ([]string, error)
func Remove(path string) error
func RemoveDir(path string) error
func RemoveFile(path string) error
func Rename(srcPath, dstPath string) error
func RenameDir(srcPath string, dstPath string) error
func RenameFile(srcPath, dstPath string) error
func Stat(path string) (os.FileInfo, error)
func TmpDirPath() string
func TmpFilePath() string
func Walk(path string, fn iofs.WalkDirFunc) error
func WalkDir(path string, fn iofs.WalkDirFunc) error
func WriteFile(path string, data []byte) error
License
GoZoox is released under the MIT License.
# Packages
No description provided by the author
# Functions
AppendFile appends a file.
BaseName returns the last element of path.
Chmod changes the mode of the named file to mode.
Chown changes the numeric uid and gid of the named file.
ConfigDir returns the config dir by user
if user is root, return system config dir if user is common user, return user home config dir.
Copy copies a file or directory.
CopyDir copies a directory.
CopyFile copies a file.
CreateDir creates a directory.
CreateFile creates a file.
CreateSymbolicLink creates a symbolic link.
CurrentDir returns the path of the current directory.
DirName returns all but the last element of path.
ExtName returns the file extension of path.
ExtractTarGz extracts a tar.gz file.
HomeDir returns the user home directory.
IsAbsPath checks whether the path is absolute.
IsDir checks whether the path is a directory.
IsEmpty checks whether the dir/file is empty.
IsExist checks whether a file or directory exists.
IsFile checks whether the path is a file.
IsSymbolicLink checks whether the path is a symbolic link.
JoinConfigDir returns the config of appName + configName.
JoinCurrentDir returns the path which relative with current dir.
JoinHomeDir returns the path which relative with homedir.
JoinPath joins any number of path elements into a single path, adding a.
ListDir lists the files in a directory.
Merge merges files into one file.
Mkdir creates a directory.
Mkdirp creates a deep directory.
Move moves a file or directory.
MoveDir moves a directory.
MoveFile moves a file.
Open opens a file, if file not found, creates it.
OpenFile opens a file.
ReadFile reads a file.
ReadFileAsString reads a file as string.
ReadFileLines reads a file by line.
Remove removes a file or directory.
RemoveDir removes a directory.
RemoveFile removes a file.
Rename renames a file or directory.
RenameDir renames a directory.
RenameFile renames a file.
Size returns the size of the file.
Stat returns the FileInfo structure describing file.
SystemConfigDir returns the system config directory, which is /etc.
TmpDirPath returns the path of the temporary directory.
TmpFilePath returns the path of the temporary file.
UserConfigDir returns the user config directory, which is $HOME/.config.
Walk walks the files in a directory.
WalkDir walks the files in a directory.
WatchDir watches the changes of files.
WriteFile writes a file.
# Variables
Version is the current version of the package.