/* FUSE: Filesystem in Userspace Copyright (C) 2001-2004 Miklos Szeredi This program can be distributed under the terms of the GNU GPL. See the file COPYING. */ #include #include #include #include #include int really_getattr(const char *path, struct stat *stbuf); static int hello_getattr(const char *path, struct stat *stbuf) { return really_getattr(path,stbuf); }; int really_getdir(const char*path, fuse_dirh_t * h, fuse_dirfil_t * filler); static int hello_getdir(const char *path, fuse_dirh_t h, fuse_dirfil_t filler) { return really_getdir(path, &h, &filler); } int really_open(const char *path, int flags); static int hello_open(const char *path, int flags) { return really_open(path, flags); }; int really_read(const char *path, char *buf, size_t size, off_t offset); static int hello_read(const char *path, char *buf, size_t size, off_t offset) { return really_read(path, buf, size, offset); } static struct fuse_operations hello_oper = { .getattr = hello_getattr, .getdir = hello_getdir, .open = hello_open, .read = hello_read, }; int init_filesystem(); int main(int argc, char *argv[]) { const int ret = init_filesystem(); if (ret) { printf("Failed to initialise filesystem!\n"); return ret; } else { return fuse_main(argc, argv, &hello_oper); }; }