Categorygithub.com/pschlump/filelib
modulepackage
1.0.12
Repository: https://github.com/pschlump/filelib.git
Documentation: pkg.go.dev

# README

filelib

license

Go (golang) miscellaneous file and templating routines

A library of convenience functions for dealing with files.

func Exists(name string) bool {

Return true if file exists.

func GetFilenames(dir string) (filenames, dirs []string) {

GetFilenames gets a list of file names and directorys.

func ExistsIsDir(name string) bool {

Returns true if name exists and is a directory.

func InArray(lookFor string, inArr []string) bool {

Returns true if lookFor is in the array inArr. A more general form of this is in the pluto library that uses generics.

func InArrayN(lookFor string, inArr []string) int {

Searches the array inArr for lookFor returning the position if found, or -1 if not found.

func InArrayInt(lookFor int, inArr []int) bool {

Searches the array of int inArr for the value lookFor returning true if found.

func AllFiles(path, match string) (fns, dirs []string) {

Recursively searches for all the files in a path.

# Functions

AllFiles returns a recursive list of all files (excluding all directories).
No description provided by the author
No description provided by the author
Exists reports whether the named file or directory exists.
ExistsIsDir returns true if the directory exists.
No description provided by the author
Fopen opens a file with a mode string - similar to C fopen.
GetFilenames gets a list of file names and directories.
InArray returns true if `lookFor` is found in `inArr`.
InArrayInt returns true if the interger lookFor isfound in the int slice inArr.
InArrayN returns the position if `lookFor` is found in `inArr`, else -1.
InPatternArray seqrches a set of regular expression patterns in 'pat' and sees if any match.
Qt is a string quick template.
QtR is a string quick template.
No description provided by the author
No description provided by the author
RmExt remove the extension from a file name and returns the name.
SearchPathApp searches a set of paths for a particular file.
SubstitueUserInFilePath looks up the user and replaces '~' or '~name' whith the home direcotry.

# Type aliases

No description provided by the author