// TODO: This gets called twice, @Tv42 says this is just how the API works func (file *File) Listxattr(req *fuse.ListxattrRequest, res *fuse.ListxattrResponse, intr fs.Intr) fuse.Error { // Get how large of a buffer is needed buf := make([]byte, 0) size, err := syscallx.Listxattr(file.Path, buf) if err != nil { fmt.Printf("Err listing attr: %s\n", err) return err } buf = make([]byte, size) size, err = syscallx.Listxattr(file.Path, buf) if err != nil { fmt.Printf("Err listing attr2: %s\n", err) return err } if size > 0 { attrNameBytes := bytes.Split(buf[:size-1], []byte{0}) for _, name := range attrNameBytes { res.Append(string(name)) } } return nil }
func (x *IdNode) Listxattr(ctx context.Context, req *f.ListxattrRequest, resp *f.ListxattrResponse) error { logD("Listxattr", "path", x.Path) names := xattr.List(string(x.Path)) if names != nil { resp.Append(names...) } return nil }
// Listxattr lists extended attributes associated with this object node. func (o *Object) Listxattr(ctx context.Context, req *fuse.ListxattrRequest, resp *fuse.ListxattrResponse) error { var keys []string if !Xattr { return fuse.ENOTSUP } for k := range o.sh.ObjectMetadataXattr().Headers(objectMetaHeaderXattr) { keys = append(keys, k) } sort.Strings(keys) for _, key := range keys { resp.Append(strings.TrimPrefix(key, objectMetaHeaderXattr)) } return nil }
func (f *listxattr) Listxattr(req *fuse.ListxattrRequest, resp *fuse.ListxattrResponse, intr fs.Intr) fuse.Error { f.Listxattrs.Listxattr(req, resp, intr) resp.Append("one", "two") return nil }
// Listxattr is called to list all xattrs of this file. func (e *Entry) Listxattr(ctx context.Context, req *fuse.ListxattrRequest, resp *fuse.ListxattrResponse) error { resp.Append("brig.hash") return nil }