go-mtree/keywords_unsupported.go

38 lines
913 B
Go
Raw Normal View History

// +build !linux
package mtree
2016-04-15 22:39:18 +00:00
import (
"archive/tar"
"fmt"
"io"
"os"
)
var (
2016-04-15 22:39:18 +00:00
unameKeywordFunc = func(path string, info os.FileInfo, r io.Reader) (string, error) {
if hdr, ok := info.Sys().(*tar.Header); ok {
return fmt.Sprintf("uname=%s", hdr.Uname), nil
}
return "", nil
}
2016-04-15 22:39:18 +00:00
uidKeywordFunc = func(path string, info os.FileInfo, r io.Reader) (string, error) {
if hdr, ok := info.Sys().(*tar.Header); ok {
return fmt.Sprintf("uid=%d", hdr.Uid), nil
}
return "", nil
}
2016-04-15 22:39:18 +00:00
gidKeywordFunc = func(path string, info os.FileInfo, r io.Reader) (string, error) {
if hdr, ok := info.Sys().(*tar.Header); ok {
return fmt.Sprintf("gid=%d", hdr.Gid), nil
}
return "", nil
}
2016-04-15 22:39:18 +00:00
nlinkKeywordFunc = func(path string, info os.FileInfo, r io.Reader) (string, error) {
return "", nil
}
2016-04-15 22:39:18 +00:00
xattrKeywordFunc = func(path string, info os.FileInfo, r io.Reader) (string, error) {
return "", nil
}
)