Documentation ¶
Overview ¶
Package io provides file or directory io utilities.
Index ¶
- func BaseDir(s string) string
- func Basename(s string) string
- func CallerInfo(skip int) (file string, line int, fn string)
- func ChangeWorkDir(workDir string) error
- func CreateFile(path, filename string) error
- func DirName(s string) string
- func EnsureWorkDir(skip int, dir string) (ok bool)
- func Filename(s string) string
- func GetRelativePath(level int) string
- func GetWorkDir() string
- func IsPathNotExist(path string) bool
- func Visit(files *[]string) filepath.WalkFunc
- func WriterFile(path, filename string, in []byte) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BaseDir ¶
BaseDir get base dir from a path /a/b/c.ext => /a/b /a/b/c => /a/b
func Basename ¶
Basename get the base name from a path /a/b/c.ext => /a/b/c
func CallerInfo ¶ added in v0.5.3
CallerInfo get call info, include filename, line number or function name
func ChangeWorkDir ¶
ChangeWorkDir change current working dir
func EnsureWorkDir ¶
EnsureWorkDir ensure the working dir is set the correct dir specified by user
func Filename ¶
Filename get file name from a path /a/b/c.ext => c.ext
func IsPathNotExist ¶
IsPathNotExist check if path is not exist
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.