package backuptar

import "github.com/Microsoft/go-winio/backuptar"

Index

Functions

func BasicInfoHeader

func BasicInfoHeader(name string, size int64, fileInfo *winio.FileBasicInfo) *tar.Header

BasicInfoHeader creates a tar header from basic file information.

func EncodeReparsePointFromTarHeader

func EncodeReparsePointFromTarHeader(hdr *tar.Header) []byte

EncodeReparsePointFromTarHeader reads the ReparsePoint structure from the tar header and encodes it into a byte slice. The file for which this function is called must be a symlink.

func ExtendedAttributesFromTarHeader

func ExtendedAttributesFromTarHeader(hdr *tar.Header) ([]byte, error)

ExtendedAttributesFromTarHeader reads the EAs associated with the header of the current file from the tar header and returns it as a byte slice.

func FileInfoFromHeader

func FileInfoFromHeader(hdr *tar.Header) (name string, size int64, fileInfo *winio.FileBasicInfo, err error)

FileInfoFromHeader retrieves basic Win32 file information from a tar header, using the additional metadata written by WriteTarFileFromBackupStream.

func SecurityDescriptorFromTarHeader

func SecurityDescriptorFromTarHeader(hdr *tar.Header) ([]byte, error)

SecurityDescriptorFromTarHeader reads the SDDL associated with the header of the current file from the tar header and returns the security descriptor into a byte slice.

func WriteBackupStreamFromTarFile

func WriteBackupStreamFromTarFile(w io.Writer, t *tar.Reader, hdr *tar.Header) (*tar.Header, error)

WriteBackupStreamFromTarFile writes a Win32 backup stream from the current tar file. Since this function may process multiple tar file entries in order to collect all the alternate data streams for the file, it returns the next tar file that was not processed, or io.EOF is there are no more.

func WriteTarFileFromBackupStream

func WriteTarFileFromBackupStream(t *tar.Writer, r io.Reader, name string, size int64, fileInfo *winio.FileBasicInfo) error

WriteTarFileFromBackupStream writes a file to a tar writer using data from a Win32 backup stream.

This encodes Win32 metadata as tar pax vendor extensions starting with MSWINDOWS.

The additional Win32 metadata is:

Source Files

doc.go strconv.go tar.go

Version
v0.6.2 (latest)
Published
Apr 9, 2024
Platform
windows/amd64
Imports
10 packages
Last checked
10 hours ago

Tools for package owners.