Documentation
¶
Index ¶
- func DirsExist(paths ...string) error
- func FileExists(path string) bool
- func FileReadLine(path string) (string, error)
- func FileSize(path string) (int64, error)
- func FindFileInParentDirs(startPath, filename string) (string, error)
- func FindFilesInSubDir(searchDir, filename string, maxdepth int) ([]string, error)
- func IsDir(path string) (bool, error)
- func IsFile(path string) (bool, error)
- func IsRegularFile(path string) (bool, error)
- func Mkdir(path string) error
- func PathsJoin(rootPath string, relPaths []string) []string
- func SameFile(a, b string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileExists ¶
FileExists returns true if path exist and is a file
func FileReadLine ¶
FileReadLine reads the first line from a file
func FindFileInParentDirs ¶
FindFileInParentDirs finds a directory that contains filename. The function starts searching in startPath and then checks recursively each parent directory for the file. It returns the absolute path to the first found directory contains the file. If it reaches the root directory without finding the file it returns os.ErrNotExist
func FindFilesInSubDir ¶
FindFilesInSubDir returns all directories that contain filename that are in searchDir. The function descends up to maxdepth levels of directories below searchDir
func IsDir ¶
IsDir returns true if the path is a directory. If the directory does not exist, the error from os.Stat() is returned.
func IsFile ¶
IsFile returns true if path is a file. If the path does not exist an error is returned
func IsRegularFile ¶ added in v0.11.1
IsRegularFile returns true if path is a regular file. If the directory does not exist, the error from os.Stat() is returned.
Types ¶
This section is empty.