Documentation ¶
Index ¶
- func AddFileToZip(zipWriter *zip.Writer, dir string, filename string) error
- func Checksum(fn string) (string, error)
- func FileExists(filename ...string) bool
- func FindFiles(dir string, pattern *regexp.Regexp) ([]string, error)
- func IsZeroLengthFile(fn string) bool
- func OpenFile(fn string) (io.ReadCloser, error)
- func OpenNestedZip(parent, child string) (*zip.Reader, error)
- func Resolve(filename string) (string, error)
- func ResolveFileName(fn string) string
- func ShaFiles(dir string, outfile string, re *regexp.Regexp) error
- func Unzip(src, dest string) error
- func ZipDir(filename string, dir string, pattern *regexp.Regexp) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddFileToZip ¶ added in v10.0.5
AddFileToZip will add a file to a zip (writer), dir is the directory inside the zip archive that you want the file to exist in. If dir is `""`, then the file will be in the root of the archive
func FileExists ¶
FileExists returns true if the path components exist
func IsZeroLengthFile ¶
IsZeroLengthFile returns true if the filename specified is empty (0 bytes)
func OpenFile ¶
func OpenFile(fn string) (io.ReadCloser, error)
OpenFile will open a file and if it's gzipped return a gzipped reader as io.ReadCloser but will close both streams on close
func OpenNestedZip ¶ added in v10.0.5
OpenNestedZip opens zip archive parent and searches it for child, then opens child and returns a zip.Reader. Useful for zip files inside zip files
func ResolveFileName ¶
ResolveFileName will attempt to resolve a filename attempting to look at both the basic name or the name + .gz extension
func ShaFiles ¶ added in v10.0.5
ShaFiles will calculate the checksum for all files in dir that match re and write them out to outfile. Useful for code releases.
Types ¶
This section is empty.