From 16911b5b0ace67db0bfb1e1b545a57135b4997d3 Mon Sep 17 00:00:00 2001 From: Ben McClelland Date: Thu, 27 Jun 2019 17:27:22 -0700 Subject: [PATCH] findxattr listxattr add comment example exec to examples --- examples/findxattr/main.go | 5 +++++ examples/listxattr/main.go | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/examples/findxattr/main.go b/examples/findxattr/main.go index 1635669..fbbe74d 100644 --- a/examples/findxattr/main.go +++ b/examples/findxattr/main.go @@ -14,6 +14,11 @@ import ( scoutfs "github.com/versity/scoutfs-go" ) +// # find possible inodes with indexed attribute, indx triggers scoutfs indexing +// touch /mnt/scoutfs/file +// setfattr -n scoutfs.indx.myattr /mnt/scoutfs/file +// ./findxattr /mnt/scoutfs scoutfs.indx.myattr + func main() { if len(os.Args) != 3 || os.Args[1] == "-h" { fmt.Fprintln(os.Stderr, "usage:", os.Args[0], " ") diff --git a/examples/listxattr/main.go b/examples/listxattr/main.go index d79c8c5..815814f 100644 --- a/examples/listxattr/main.go +++ b/examples/listxattr/main.go @@ -14,6 +14,16 @@ import ( scoutfs "github.com/versity/scoutfs-go" ) +// # can list more attributes than getfattr +// touch /mnt/scoutfs/file +// for i in $(seq 1 10000); do setfattr -n "user.lots-$i" /mnt/scoutfs/file; done +// ./listxattr /mnt/scoutfs/file | wc -l +// +// # can list scoutfs hidden attrs +// touch /mnt/scoutfs/file +// setfattr -n scoutfs.hide.invisible /mnt/scoutfs/file +// ./listxattr /mnt/scoutfs/file + func main() { if len(os.Args) != 2 || os.Args[1] == "-h" { fmt.Fprintln(os.Stderr, "usage:", os.Args[0], "")