package
1.12.6
Repository: https://github.com/go-dev-frame/sponge.git
Documentation: pkg.go.dev

# README

gofile

File and directory management libraries.


Example of use

    // determine if a file or folder exists
    gofile.IsExists("/tmp/test/")

    // get the path to program execution
    gofile.GetRunPath()

    // get all files in a directory (absolute path)
    gofile.ListFiles("/tmp/")

    // get all files in a directory by prefix (absolute path)
    gofile.ListFiles(dir, WithPrefix("READ"))

    // get all files in a directory by suffix (absolute path)
    gofile.ListFiles(dir, WithSuffix(".go"))

    // get all files in a directory based on a string (absolute path)
    gofile.ListFiles(dir, WithContain("file"))

# Functions

CreateDir create dir.
FilterDirs filter directories that meet the criteria.
FindAllSubBytes find all substrings, including start and end marks.
FindSubBytes find first substrings, including start and end marks.
FindSubBytesNotIn find substrings, excluding start and end tags.
FuzzyMatchFiles fuzzy matching of documents, * only.
GetDir get dir, not include the last separator.
GetFileDir get dir, include the last separator.
GetFilename get file name.
GetFilenameWithoutSuffix get file name without suffix.
GetFileSuffixName get file suffix name, example: ".txt".
GetPathDelimiter get separator by system type.
GetRunPath get the absolute path of the program execution.
GetSuffixDir get suffix dir, not include the last separator.
IsExists determine if a file or folder exists.
IsWindows determining whether a window environment.
Join joins any number of path elements into a single path.
ListDirs list all sub dirs, not including itself.
ListDirsAndFiles iterates through all subdirectories of the specified directory, returning the absolute path to the file.
ListFiles iterates over all files in the specified directory, returning the absolute path to the file.
ListSubDirs list all sub dirs that have the specified sub dir, if sub dir is empty, return all sub dirs.
WithContain set contain matching.
WithNoAbsolutePath set no absolute path.
WithPrefix set prefix matching.
WithSuffix set suffix matching.

# Type aliases

Option set the file options.