go-fuse
go-fuse copied to clipboard
Changing filesize in Getattr Loopback
In my custom filesystem which extends the loopback filesystem - I want to change the file size in Getattr. But it seems that the Getattr is only being called on the root level according to the debug. And it is not being reflected in each of the files.
func (s *SimpleNode) Getattr(ctx context.Context, f fs.FileHandle, out *fuse.AttrOut) syscall.Errno {
out.Size = 100
return s.LoopbackNode.Getattr(ctx, f, out)
}
Can somebody tell me where I am going wrong?
You also have to change Lookup()
!
Also, s.LoopbackNode.Getattr(ctx, f, out)
will overwrite anything that's in out
, no? So you have to change out.Size after!