From 9feca9b0b90a107ece6be1b4d197e08020a40690 Mon Sep 17 00:00:00 2001 From: Omar Rizwan Date: Sun, 13 Dec 2020 22:02:29 -0800 Subject: Add unlink support. Make by-title/ writable. Add . and .. entries. Still haven't added the unlink handler to by-title/, though. --- fs/tabfs.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'fs/tabfs.c') diff --git a/fs/tabfs.c b/fs/tabfs.c index 13cd7ee..803d6c2 100644 --- a/fs/tabfs.c +++ b/fs/tabfs.c @@ -225,9 +225,18 @@ tabfs_releasedir(const char *path, struct fuse_file_info *fi) { /* }); */ } +static int tabfs_unlink(const char *path) { + send_request("{op: %Q, path: %Q}", "unlink", path); + + receive_response("{}", NULL); + + return 0; +} + static struct fuse_operations tabfs_filesystem_operations = { .getattr = tabfs_getattr, /* To provide size, permissions, etc. */ .readlink = tabfs_readlink, + .open = tabfs_open, /* To enforce read-only access. */ .read = tabfs_read, /* To provide file content. */ .write = tabfs_write, @@ -235,7 +244,9 @@ static struct fuse_operations tabfs_filesystem_operations = { .opendir = tabfs_opendir, .readdir = tabfs_readdir, /* To provide directory listing. */ - .releasedir = tabfs_releasedir + .releasedir = tabfs_releasedir, + + .unlink = tabfs_unlink }; int main(int argc, char **argv) { -- cgit v1.2.3