diff options
| author | Alejandro Soto <alejandro@34project.org> | 2022-01-05 07:08:53 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2022-01-05 07:11:51 -0600 |
| commit | 92121f5db1ccec523c1b7eb0a817f757b5ef899a (patch) | |
| tree | bae9af4e32711f08cac4338159de6b6f64299774 /examples | |
| parent | c1bd6716bd53cb4270eeb032f150ac2c7c1a8f96 (diff) | |
Implement Rmdir
Diffstat (limited to '')
| -rw-r--r-- | examples/passthrough.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/examples/passthrough.rs b/examples/passthrough.rs index e8c51ca..7b8236b 100644 --- a/examples/passthrough.rs +++ b/examples/passthrough.rs @@ -145,6 +145,15 @@ impl Passthrough { reply.known(New(&mut self.known, Inode::new(path, metadata)), Ttl::MAX) } + async fn rmdir<'o>(&mut self, (request, reply): Op<'o, ops::Rmdir>) -> Done<'o> { + let (reply, inode) = reply.and_then(self.known(request.ino()))?; + + //FIXME: this is not right + let (reply, ()) = reply.and_then(fs::remove_dir(inode.path.join(request.name())).await)?; + + reply.ok() + } + async fn open<'o>(&mut self, (request, reply): Op<'o, ops::Open>) -> Done<'o> { let (reply, inode) = reply.and_then(self.known(request.ino()))?; let options = { @@ -350,6 +359,7 @@ async fn main_loop(session: Start, mut fs: Passthrough) -> FuseResult<()> { Getattr(getattr) => fs.getattr(getattr.op()?), Readlink(readlink) => fs.readlink(readlink.op()?).await, Mkdir(mkdir) => fs.mkdir(mkdir.op()?).await, + Rmdir(rmdir) => fs.rmdir(rmdir.op()?).await, Open(open) => fs.open(open.op()?).await, Read(read) => fs.read(read.op()?).await, Write(write) => fs.write(write.op()?).await, |
