Documentation
¶
Overview ¶
file 文件相关的一些辅助函数
Index ¶
- func Basename(path string) string
- func CheckPathExist(path string) bool
- func Chmod(filename string, mode os.FileMode) bool
- func Chown(name string, info os.FileInfo) error
- func CopyFile(distName, srcName string) (w int64, err error)
- func Fclose(handle *os.File) error
- func Fgetcsv(handle *os.File, length int, delimiter rune) ([][]string, error)
- func FileChown(filename string, uid, gid int) bool
- func FileExists(filename string) bool
- func FileGetContents(filename string) (string, error)
- func FilePutContents(filename string, data string, mode os.FileMode) error
- func FileSize(filename string) (int64, error)
- func Filebase(file string) string
- func Fileline(file string, line int) string
- func Filemtime(filename string) (int64, error)
- func Getcwd() (string, error)
- func Glob(pattern string) ([]string, error)
- func Gunzip(in []byte) ([]byte, error)
- func Gzip(in []byte) ([]byte, error)
- func IsDir(filename string) (bool, error)
- func IsFile(filename string) bool
- func IsReadable(filename string) bool
- func IsWriteable(filename string) bool
- func LoadGobData(data interface{}, fileName string)
- func Mkdir(filename string, mode os.FileMode) error
- func Pathinfo(path string, options int) map[string]string
- func Realpath(path string) (string, error)
- func Rename(oldname, newname string) error
- func RunShell(exeStr string) (string, error)
- func Stat(filename string) (os.FileInfo, error)
- func StoreGobData(data interface{}, fileName string) error
- func Touch(filename string) (bool, error)
- func Unlink(filename string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Chown ¶
Chown 清空文件并保持文件权限不变,并非linux chown操作 Empty the file and keep the file permissions unchanged not the linux chown operation
func FileGetContents ¶
FileGetContents file_get_contents()
func FilePutContents ¶
FilePutContents file_put_contents()
func LoadGobData ¶
func LoadGobData(data interface{}, fileName string)
LoadGobData 将gob写入的内容,载入到data中
func Pathinfo ¶
Pathinfo pathinfo() -1: all; 1: dirname; 2: basename; 4: extension; 8: filename Usage: Pathinfo("/home/go/path/src/php2go/php2go.go", 1|2|4|8)
func StoreGobData ¶
StoreGobData store gob data
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.