Documentation ¶
Index ¶
- Constants
- func Basename(path string) string
- func Chmod(path string, mode os.FileMode) error
- func Copy(src string, dst string) error
- func CopyDir(src string, dst string) (err error)
- func CopyFile(src, dst string) (err error)
- func Create(path string) (*os.File, error)
- func Dir(path string) string
- func DirNames(path string) ([]string, error)
- func Exists(path string) bool
- func Ext(path string) string
- func FormatSize(raw float64) string
- func GetBinContents(path string) []byte
- func GetBinContentsByTwoOffsets(reader io.ReaderAt, start int64, end int64) []byte
- func GetBinContentsByTwoOffsetsByPath(path string, start int64, end int64) []byte
- func GetBinContentsTilChar(reader io.ReaderAt, char byte, start int64) ([]byte, int64)
- func GetBinContentsTilCharByPath(path string, char byte, start int64) ([]byte, int64)
- func GetContents(path string) string
- func GetNextCharOffset(reader io.ReaderAt, char byte, start int64) int64
- func GetNextCharOffsetByPath(path string, char byte, start int64) int64
- func Glob(pattern string, onlyNames ...bool) ([]string, error)
- func Home() (string, error)
- func Info(path string) (os.FileInfo, error)
- func IsDir(path string) bool
- func IsFile(path string) bool
- func IsReadable(path string) bool
- func IsWritable(path string) bool
- func Join(subPath ...string) string
- func MTime(path string) int64
- func MTimeMillisecond(path string) int64
- func MainPkgPath() string
- func Mkdir(path string) error
- func Move(src string, dst string) error
- func Open(path string) (*os.File, error)
- func OpenFile(path string, flag int, perm os.FileMode) (*os.File, error)
- func OpenWithFlag(path string, flag int) (*os.File, error)
- func OpenWithFlagPerm(path string, flag int, perm int) (*os.File, error)
- func PutBinContents(path string, content []byte) error
- func PutBinContentsAppend(path string, content []byte) error
- func PutContents(path string, content string) error
- func PutContentsAppend(path string, content string) error
- func Pwd() string
- func ReadableSize(path string) string
- func RealPath(path string) string
- func Remove(path string) error
- func Rename(src string, dst string) error
- func ScanDir(path string, pattern string, recursive ...bool) ([]string, error)
- func Search(name string, prioritySearchPaths ...string) (realPath string, err error)
- func SelfDir() string
- func SelfName() string
- func SelfPath() string
- func Size(path string) int64
- func Stat(path string) (os.FileInfo, error)
- func TempDir() string
- func Truncate(path string, size int) error
Constants ¶
View Source
const ( // 系统路径分割符 Separator = string(filepath.Separator) )
Variables ¶
This section is empty.
Functions ¶
func GetBinContentsByTwoOffsets ¶
从reader中获取从位置start到end之间的二进制数据
func GetBinContentsByTwoOffsetsByPath ¶
从文件path中,获取从位置start到end之间的二进制数据
func GetBinContentsTilChar ¶
在reader中,获取从start到字符char之间二进制数据,包含char在内
func GetBinContentsTilCharByPath ¶
在文件path中,获取从start位置到字符char之间的二进制数据,包含char在内
func GetNextCharOffset ¶
从start之后查找char字符,如果找到返回找到位置,否则返回-1
func GetNextCharOffsetByPath ¶
在文件path中从start之后查找字符char,找到则返回所在位置,否则返回-1
func OpenWithFlagPerm ¶
以指定权限打开文件或文件夹
func PutBinContentsAppend ¶
追回二进制数据到文件,文件不存在时创建
func PutContentsAppend ¶
追加字符串到文件,文件不存在时创建文件
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.