aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorOmar Rizwan <omar@omar.website>2020-12-13 22:02:29 -0800
committerOmar Rizwan <omar@omar.website>2020-12-13 22:02:29 -0800
commit9feca9b0b90a107ece6be1b4d197e08020a40690 (patch)
treea4b747a8f6efc54eea93b342dc019e6cde2ada2c /fs
parentcabc3fe03f1d8830a323b6258bfcc454c066daaf (diff)
Add unlink support. Make by-title/ writable. Add . and .. entries.
Still haven't added the unlink handler to by-title/, though.
Diffstat (limited to 'fs')
-rw-r--r--fs/tabfs.c13
1 files changed, 12 insertions, 1 deletions
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) {