Documentation ¶
Index ¶
- Constants
- func CreateNewFile(fileName string) (*os.File, error)
- func DeepTraversalDir(path string, fileDo func(path string, info os.FileInfo) FileDoFuncResult) (info os.FileInfo, err error)
- func DeepTraversalDirWithSelf(path string, fileDo func(path string, info os.FileInfo) FileDoFuncResult) (info os.FileInfo, err error)
- func FileReadAll(path string) ([]byte, error)
- func FileScanner(path string) (*bufio.Scanner, *os.File, error)
- func IsFileExist(fileName string) bool
- func ListDirs(path string, dirDo func(dPath string)) (err error)
- func MakeSureDirExist(path string) error
- func Pwd() string
- func RemoveDirctory(path string) error
- func RemoveFileIfExist(fileName string) error
- func SafeOpenFile(fileName string) (*os.File, error)
- type FileDoFunc
- type FileDoFuncResult
Constants ¶
View Source
const PathSep = string(os.PathSeparator)
PathSep path sep .
Variables ¶
This section is empty.
Functions ¶
func DeepTraversalDir ¶
func DeepTraversalDir(path string, fileDo func(path string, info os.FileInfo) FileDoFuncResult) (info os.FileInfo, err error)
DeepTraversalDir .
func DeepTraversalDirWithSelf ¶
func DeepTraversalDirWithSelf(path string, fileDo func(path string, info os.FileInfo) FileDoFuncResult) (info os.FileInfo, err error)
DeepTraversalDirWithSelf .
func FileReadAll ¶
func IsFileExist ¶
IsFileExist 判断文件是否存在 存在返回 true 不存在返回false.
func MakeSureDirExist ¶
MakeSureDirExist if dir not exist, create it.
func RemoveDirctory ¶
func RemoveFileIfExist ¶
Types ¶
type FileDoFunc ¶
type FileDoFunc func(path string, info os.FileInfo) FileDoFuncResult
type FileDoFuncResult ¶
type FileDoFuncResult int
const ( FILE_DO_FUNC_RESULT_DEFAULT FileDoFuncResult = iota // continue FILE_DO_FUNC_RESULT_STOP_TRAV // stop trav FILE_DO_FUNC_RESULT_NO_DEAL // not deal that file and continue )
Click to show internal directories.
Click to hide internal directories.