forked from mirrors/tar-split
verify: starts of a checking function
This commit is contained in:
parent
5c8d5cacba
commit
867071d1e5
4 changed files with 158 additions and 45 deletions
31
tar/verify/example_xattr.go
Normal file
31
tar/verify/example_xattr.go
Normal file
|
@ -0,0 +1,31 @@
|
|||
// +build ignore
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
verify "."
|
||||
)
|
||||
|
||||
func main() {
|
||||
for _, arg := range os.Args[1:] {
|
||||
keys, err := verify.Listxattr(arg)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
continue
|
||||
}
|
||||
if len(keys) > 0 {
|
||||
fmt.Printf("%s : %q\n", arg, keys)
|
||||
for _, key := range keys {
|
||||
buf, err := verify.Lgetxattr(arg, key)
|
||||
if err != nil {
|
||||
fmt.Printf(" ERROR: %s\n", err)
|
||||
continue
|
||||
}
|
||||
fmt.Printf(" %s = %s\n", key, string(buf))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue