fs

package
v0.0.0-...-c049333 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirExists

func DirExists(path string) bool

DirExists returns true if the directory path was found and is in fact a directory; otherwise, it returns false

func FileExists

func FileExists(path string) bool

FileExists returns true if the file path was found and is in fact a file; otherwise, it returns false

func GetDirInfo

func GetDirInfo(path string) (fs.FileInfo, error)

GetDirInfo returns an fs.FileInfo representing the directory at path. If the file was not found, it will return a custom error. If there is another error, it will be of type *fs.PathError

func GetFileInfo

func GetFileInfo(path string) (fs.FileInfo, error)

GetFileInfo returns an fs.FileInfo representing the file at path. If the file was not found, it will return a custom error. If there is another error, it will be of type *fs.PathError

func GetSearchPaths

func GetSearchPaths() []string

GetSearchPaths returns a distinct list of paths defined in the PATH environment value. Also includes the current working directory in the list.

func Glob

func Glob(path string, pattern string, ignoreCase bool) (matches []string, err error)

Glob returns the names of all files and directories matching pattern or nil if there are no matches.

It uses os.ReadDir and thus may return any error returned from that call.

func GlobDirs

func GlobDirs(path string, pattern string, ignoreCase bool) (matches []string, err error)

GlobDirs returns the names of all directories matching pattern or nil if there are no matches.

It uses os.ReadDir and thus may return any error returned from that call.

func GlobFiles

func GlobFiles(path string, pattern string, ignoreCase bool) (matches []string, err error)

GlobFiles returns the names of all files and directories matching pattern or nil if there are no matches.

It uses os.ReadDir and thus may return any error returned from that call.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL