Documentation ¶
Overview ¶
Package tgzfile provides functionality related to gzipped tar files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
Create creates a tar.gz file containing the given files. File permissions are mirrored from the file system.
files := map[string]string{ "./testdata/create-1.txt": "execute-me", // source file name : destination file name "./testdata/create-2.txt": "data/f2.txt", } err := Create("test.tar.gz", files)
func CreatePermissionFunc ¶
func CreatePermissionFunc(filename string, files map[string]string, permissions func(string) int64) error
CreatePermissionFunc creates a tar.gz file containing the given files. File permissions may be changed by the permission func.
files := map[string]string{ "./testdata/create-1.txt": "execute-me", // source file name : destination file name "./testdata/create-2.txt": "data/f2.txt", } permissions := func(filename string) int64 { if filename == "execute-me" { return 0777 // Overwrite permissions } return -1 // Use permissions from file system } err := CreatePermissionFunc("test.tar.gz", files, permissions)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.