summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--examples/passthrough.rs10
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,