fs

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ZipNoCompression      = flate.NoCompression
	ZipBestSpeed          = flate.BestSpeed
	ZipMediumCompression  = 5
	ZipBestCompression    = flate.BestCompression
	ZipDefaultCompression = flate.DefaultCompression
	ZipHuffmanOnly        = flate.HuffmanOnly
)

Variables

This section is empty.

Functions

func CopyDir

func CopyDir(src string, dst string) (err error)

CopyDir recursively copies a directory tree, attempting to preserve permissions. Source directory must exist, destination directory must *not* exist. Symlinks are ignored and skipped.

func CopyFile

func CopyFile(src, dst string) (err error)

CopyFile copies the contents of the file named src to the file named by dst. The file will be created if it does not already exist. If the destination file exists, all it's contents will be replaced by the contents of the source file. The file mode will be copied from the source and the copied data is synced/flushed to stable storage.

func TarIt

func TarIt(src string, dst string) error

TarIt takes a source and variable writers and walks 'source' writing each file found to the tar writer; the purpose for accepting multiple writers is to allow for multiple outputs (for example a file, or md5 hash)

func UnTarIt

func UnTarIt(src string, dst string) error

UnTarIt takes a destination path and a reader; a tar reader loops over the tarfile creating the file structure at 'dst' along the way, and writing any files

func UnZipIt

func UnZipIt(src, dst string) error

func ZipIt

func ZipIt(src, dst string, compressionLevel int) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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