Skip to content

Instantly share code, notes, and snippets.

@fd0
Created January 30, 2017 18:06
Show Gist options
  • Save fd0/df200bdb7a2668e733b55a84641c9b1f to your computer and use it in GitHub Desktop.
Save fd0/df200bdb7a2668e733b55a84641c9b1f to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"os"
"github.com/pkg/xattr"
)
func main() {
filename := os.Args[1]
list, err := xattr.Listxattr(filename)
if err != nil {
panic(err)
}
fmt.Printf("extended attributes for %v:\n", filename)
for _, attr := range list {
data, err := xattr.Getxattr(filename, attr)
if err != nil {
panic(err)
}
fmt.Printf("%v: %q\n", attr, data)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment