diff options
author | Omar Rizwan <omar@omar.website> | 2020-12-13 22:02:29 -0800 |
---|---|---|
committer | Omar Rizwan <omar@omar.website> | 2020-12-13 22:02:29 -0800 |
commit | 9feca9b0b90a107ece6be1b4d197e08020a40690 (patch) | |
tree | a4b747a8f6efc54eea93b342dc019e6cde2ada2c /fs/tabfs.c | |
parent | cabc3fe03f1d8830a323b6258bfcc454c066daaf (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/tabfs.c')
-rw-r--r-- | fs/tabfs.c | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -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) { |