diff --git a/fuse/main.go b/fuse/main.go index 3a83b3e..b1b240a 100644 --- a/fuse/main.go +++ b/fuse/main.go @@ -390,6 +390,21 @@ func (f *ITNode) Rename(ctx context.Context, name string, newParent fs.InodeEmbe return 0 } +var _ = (fs.NodeUnlinker)((*ITNode)(nil)) +func (f *ITNode) Unlink(ctx context.Context, name string) syscall.Errno { + delete(inodemap, f.path + "/" + name) + err := myfs.Remove(f.path + "/" + name) + if err != nil { + return syscall.EROFS + } + return 0 +} + +var _ = (fs.NodeRmdirer)((*ITNode)(nil)) +func (f *ITNode) Rmdir(ctx context.Context, name string) syscall.Errno { + return f.Unlink(ctx, name) +} + func main() { // This is where we'll mount the FS mntDir := "/tmp/x"