Documentation
¶
Overview ¶
文件管理.
Index ¶
- Constants
- func Basename(path string) string
- func Chmod(path string, mode os.FileMode) error
- func Copy(src string, dst string) error
- func Create(path string) error
- func Dir(path string) string
- func Exists(path string) bool
- func Ext(path string) string
- func FormatSize(raw float64) string
- func GetBinContentByTwoOffsets(file *os.File, start int64, end int64) []byte
- func GetBinContents(path string) []byte
- func GetContents(path string) string
- func GetNextCharOffset(file *os.File, char string, start int64) int64
- func Glob(pattern string) ([]string, error)
- func GoRootOfBuild() string
- func Home() (string, error)
- func Info(path string) *os.FileInfo
- func IsDir(path string) bool
- func IsFile(path string) bool
- func IsReadable(path string) bool
- func IsWritable(path string) bool
- 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 OpenWithFlag(path string, flag 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 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) []string
- func SelfDir() string
- func SelfPath() string
- func Size(path string) int64
- 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 GetBinContentByTwoOffsets ¶
获得文件内容中两个offset之间的内容 [start, end)
func GetNextCharOffset ¶
获得文件内容下一个指定字节的位置
func MainPkgPath ¶
func MainPkgPath() string
获取入口函数文件所在目录(main包文件目录), **仅对源码开发环境有效(即仅对生成该可执行文件的系统下有效)**
func PutBinContentsAppend ¶
(二进制)追加内容到文件末尾
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.