Documentation ¶
Overview ¶
Package untar provides helper function to easily extract contents of a tar stream to a file system directory.
Useful for cases where you'd want a replacement for external call to `tar x`. It differs from `tar x` call by not setting proper times on symlinks itself. Extended attributes are not supported.
It's tested on OS X and Linux amd64 and is enough to unpack linux root filesystem to a useable state.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Untar ¶
Untar extracts each item from a tar stream and saves it into file system directory. It stops on first error it encounters; if extracted over existing file system tree, matching files would be overwritten. If destination directory does not exist, it will be created.
Note that permissions on unpacked data would be set with current umask taken into account; if you expect to get exact permissions, call syscall.Umask(0) beforehand. This function does not call it itself as this changes umask process-wide, so it's safer to do this explicitly.
Owner/group of extracted files are set only if run as root (os.Getuid() == 0) and are only set as numeric values, user/group names are not taken into account.
Types ¶
This section is empty.