tarheader

package
v1.6.33 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileInfoHeaderNoLookups

func FileInfoHeaderNoLookups(fi os.FileInfo, link string) (*tar.Header, error)

FileInfoHeaderNoLookups creates a partially-populated tar.Header from fi.

Compared to the archive/tar.FileInfoHeader function, this function is safe to call from a chrooted process as it does not populate fields which would require operating system lookups. It behaves identically to tar.FileInfoHeader when fi is a FileInfo value returned from tar.Header.FileInfo().

When fi is a FileInfo for a native file, such as returned from os.Stat() and os.Lstat(), the returned Header value differs from one returned from tar.FileInfoHeader in the following ways. The Uname and Gname fields are not set as OS lookups would be required to populate them. The AccessTime and ChangeTime fields are not currently set (not yet implemented) although that is subject to change. Callers which require the AccessTime or ChangeTime fields to be zeroed should explicitly zero them out in the returned Header value to avoid any compatibility issues in the future.

From https://github.com/moby/moby/blob/v23.0.1/pkg/archive/archive.go#L439-L464 .

Types

This section is empty.

Jump to

Keyboard shortcuts

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