go-fuse icon indicating copy to clipboard operation
go-fuse copied to clipboard

Changing filesize in Getattr Loopback

Open annetteshajan opened this issue 9 months ago • 2 comments

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?

annetteshajan avatar Apr 30 '24 09:04 annetteshajan

You also have to change Lookup()!

rfjakob avatar Apr 30 '24 09:04 rfjakob

Also, s.LoopbackNode.Getattr(ctx, f, out) will overwrite anything that's in out, no? So you have to change out.Size after!

rfjakob avatar Apr 30 '24 09:04 rfjakob