Documentation ¶
Overview ¶
Copyright (C) Philip Schlump, 2013-2016. Version: 1.0.3 Tested on Mon Jun 20 18:01:48 MDT 2016
Index ¶
- func AllFiles(path, match string) (fns, dirs []string)
- func ApplyFilenames(dir string, fx ApplyFilenamesFunc) (filenames, dirs []string)
- func CleanupOldFiles(dir string, dt time.Duration)
- func Exists(name string) bool
- func ExistsIsDir(name string) bool
- func FilterArray(re string, inArr []string) (outArr []string)
- func Fopen(fn string, mode string) (file *os.File, err error)
- func GetFilenames(dir string) (filenames, dirs []string)
- func InArray(lookFor string, inArr []string) bool
- func InArrayInt(lookFor int, inArr []int) bool
- func InArrayN(lookFor string, inArr []string) int
- func InPatternArray(s string, pat []string) (rv int, err error)
- func Qt(format string, data map[string]string) string
- func QtR(format string, data map[string]interface{}) string
- func RemoveMatch(re string, inArr []string) (outArr []string)
- func ReplaceExt(fn string, newExt string) (out string)
- func RmExt(filename string) string
- func SearchPathApp(rawFileName string, appName string, searchPath string) (fullFileName string, ok bool)
- func SubstitueUserInFilePath(s string, mdata map[string]string) (rs string, has bool)
- type ApplyFilenamesFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllFiles ¶ added in v1.0.3
AllFiles returns a recursive list of all files (excluding all directories). Empty directories will be eliminated. Passing an empty string for match will return all files, but faster, skiping the regular expression pattern match.
func ApplyFilenames ¶ added in v1.0.2
func ApplyFilenames(dir string, fx ApplyFilenamesFunc) (filenames, dirs []string)
func CleanupOldFiles ¶ added in v1.0.2
func ExistsIsDir ¶ added in v1.0.2
ExistsIsDir returns true if the directory exists.
func FilterArray ¶ added in v1.0.3
func GetFilenames ¶ added in v1.0.1
GetFilenames gets a list of file names and directories. The directories '.' and '..' are removed. Other '.[.]?.*' fiels and directories are included.
func InArrayInt ¶ added in v1.0.6
InArrayInt returns true if the interger lookFor isfound in the int slice inArr.
func InArrayN ¶ added in v1.0.3
InArrayN returns the position if `lookFor` is found in `inArr`, else -1.
func InPatternArray ¶ added in v1.0.9
InPatternArray seqrches a set of regular expression patterns in 'pat' and sees if any match. -1 is returned if no match.
func Qt ¶
Qt is a string quick template. %{name%} gets replace with substitution from map if it is in map, else ""
func QtR ¶
QtR is a string quick template. It uses the same format as Qt but you get to pass a map[string]interface{}