Closed dymart closed 6 months ago
have a look at https://github.com/hanwen/go-fuse/blob/master/fs/loopback_linux.go#L21
Does that help?
I mean: if you don't want to use the syscall, you could do something like
val := "hello"
copy(dest, []byte(val))
return len(val), 0
Hey, sorry for the slow response. Your answers were great! Really appreciate it :)
Really appreciate the project.
I'm wondering if there are any examples, tests, or any more information about how to create custom xattr functions for example getxattr with v2/fs, which do not use the gatxattr syscall but sets a custom value. There were some for fuse/nodefs and fuse/pathfs.
https://github.com/hanwen/go-fuse/blob/0b3e1fde6eb5eeb1600388535913ee66f23bdc5b/fs/api.go#L246 // Getxattr should read data for the given attribute into //
dest
and return the number of bytes. Ifdest
is too // small, it should return ERANGE and the size of the attribute. // If not defined, Getxattr will return ENOATTR.The comments aren't clear how to read data for the given attribute into
dest
. Any hints or quick examples would be greatly appreciated. Even a simple explanation about how this should be approached would be very welcome.Any help or guidance on this would be appreciated. If I missed a test, example or something else that clearly explains this let me know and feel free to close the issue.
Thank you