From 74afbc7c20fe39060997708a99b02690d59dd804 Mon Sep 17 00:00:00 2001 From: Yannick Ulrich Date: Sun, 19 Feb 2023 19:11:46 +0000 Subject: [PATCH] Implemented Getattr --- fuse/main.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/fuse/main.go b/fuse/main.go index a0643bb..6f24473 100644 --- a/fuse/main.go +++ b/fuse/main.go @@ -242,6 +242,16 @@ func (fh *bytesFileWriteHandle) Flush(ctx context.Context) (errno syscall.Errno) return 0 } +var _ = (fs.NodeGetattrer)((*ITNode)(nil)) +func (bn *ITNode) Getattr(ctx context.Context, f fs.FileHandle, out *fuse.AttrOut) syscall.Errno { + out.Ino = bn.Ino + out.Mtime = bn.self.modtime + out.Ctime = bn.self.modtime + out.Atime = bn.self.modtime + out.Size = uint64(bn.self.size) + return 0 +} + var _ = (fs.NodeSetattrer)((*ITNode)(nil)) func (bn *ITNode) Setattr(ctx context.Context, fh fs.FileHandle, in *fuse.SetAttrIn, out *fuse.AttrOut) syscall.Errno { out.Size = 0;