Documentation ¶
Index ¶
- func CloseFileWithError(file *os.File, err error) error
- func CopyFile(src, dst string) (err error)
- func DirEntriesNameRxVarFirsts(dir string, rx1 *regexp.Regexp) ([]string, error)
- func DirEntriesRxSizeGt0(dir string, fileFilter FileType, rx1 *regexp.Regexp) ([]os.FileInfo, error)
- func DirEntriesRxSizeGt0Filepaths(dir string, fileFilter FileType, rx *regexp.Regexp) ([]string, error)
- func DirFilesRegexpSubmatchGreatest(dir string, rx1 *regexp.Regexp, nonZeroFilesOnly bool) ([]os.FileInfo, error)
- func DirFilesRegexpSubmatchGreatestSubmatch(dir string, rx1 *regexp.Regexp, nonZeroFilesOnly bool) (string, error)
- func DirFromPath(path string) (string, error)
- func Exists(name string) (bool, error)
- func FileInfosSplit(all []os.FileInfo, inclDotDirs bool) ([]os.FileInfo, []os.FileInfo)
- func FileinfosNames(fis []os.FileInfo) []string
- func FileinfosToFilepaths(dir string, fileInfos []os.FileInfo) []string
- func FilepathModAgeGTE(path string, s string) (bool, error)
- func FilepathModAgeLTE(path string, s string) (bool, error)
- func FilterFilenamesSizeGtZero(filepaths ...string) []string
- func GetFileModAge(fi os.FileInfo) (time.Duration, error)
- func GetFilepathModAge(path string) (time.Duration, error)
- func IsDir(name string) (bool, error)
- func IsFile(name string) (bool, error)
- func IsFileWithSizeGtZero(name string) (bool, error)
- func ReadDirRx(dir string, rx *regexp.Regexp, skipEmpty bool) ([]os.FileInfo, []string, error)
- func ReadDirSplit(dirname string, inclDotDirs bool) ([]os.FileInfo, []os.FileInfo, error)
- func ReadFileJSON(file string, v interface{}) error
- func ReaderToBytes(ior io.Reader) []byte
- func RemoveAllChildren(dir string) error
- func SplitBest(path string) (dir, file string, err error)
- func SplitBetter(path string) (dir, file string)
- func WriteFileJSON(filepath string, data interface{}, perm os.FileMode, prefix, indent string) error
- type FileInfoMore
- type FileType
- type FileWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DirEntriesNameRxVarFirsts ¶
DirEntriesNameRxVarFirsts returns a slice of the first regexp match encountered.
func DirEntriesRxSizeGt0 ¶
func DirFilesRegexpSubmatchGreatest ¶
func DirFilesRegexpSubmatchGreatest(dir string, rx1 *regexp.Regexp, nonZeroFilesOnly bool) ([]os.FileInfo, error)
DirEntriesRegexpGreatest takes a directory, regular expression and boolean to indicate whether to include zero size files and returns the greatest of a single match in the regular expression.
func DirFilesRegexpSubmatchGreatestSubmatch ¶
func DirFilesRegexpSubmatchGreatestSubmatch(dir string, rx1 *regexp.Regexp, nonZeroFilesOnly bool) (string, error)
DirFilesRegexpSubmatchGreatestSubmatch takes a directory, regular expression and boolean to indicate whether to include zero size files and returns the greatest of a single match in the regular expression.
func DirFromPath ¶
func FileInfosSplit ¶
func FileinfosNames ¶
func IsFileWithSizeGtZero ¶
IsFileWithSizeGtZero verifies a path exists, is a file and is not empty, returning an error otherwise. An os file not exists check can be done with os.IsNotExist(err) which acts on error from os.Stat()
func ReadDirSplit ¶
func ReadFileJSON ¶
ReadFileJSON reads and unmarshals a file.
func ReaderToBytes ¶
ReaderToBytes reads from an io.Reader, e.g. io.ReadCloser
func RemoveAllChildren ¶
func SplitBetter ¶
Types ¶
type FileInfoMore ¶
func NewFileInfoMoreFromPath ¶
func NewFileInfoMoreFromPath(path string) (FileInfoMore, error)
type FileWriter ¶
func NewFileWriter ¶
func NewFileWriter(path string) (FileWriter, error)
func (*FileWriter) Close ¶
func (f *FileWriter) Close()