diff --git a/Makefile b/Makefile index b58c801..4120f42 100644 --- a/Makefile +++ b/Makefile @@ -25,8 +25,8 @@ default: sifs # countwords.o, counter.o, and scanner.o: # -sifs: sifs.o src/logger.o src/tree.o - $(CC) $(CFLAGS) -o sifs src/logger.o src/tree.o sifs.o +sifs: sifs.o src/logger.o src/tree.o src/getattr.o + $(CC) $(CFLAGS) -o sifs src/logger.o src/tree.o src/getattr.o sifs.o # To create the object file countwords.o, we need the source # files countwords.c, scanner.h, and counter.h: @@ -40,9 +40,13 @@ logger.o: src/logger.c lib/logger.h tree.o: src/tree.c lib/tree.h $(CC) $(CFLAGS) -c tree.c +getattr.o: src/getattr.c lib/getattr.h + $(CC) $(CFLAGS) -c sifs.c + sifs.o: sifs.c lib/tar_structure.h $(CC) $(CFLAGS) -c sifs.c + # To start over from scratch, type 'make clean'. This # removes the executable file, as well as old .o object # files and *~ backup files: diff --git a/lib/getattr.h b/lib/getattr.h index a976ca9..b1e9756 100644 --- a/lib/getattr.h +++ b/lib/getattr.h @@ -1,5 +1,6 @@ #ifndef getattr_h #define getattr_h +#include "../lib/tree.h" #include "../lib/logger.h" #include int sifs_getattr(const char*, struct stat*); diff --git a/sifs.c b/sifs.c index 0d1e138..fb11686 100644 --- a/sifs.c +++ b/sifs.c @@ -19,7 +19,7 @@ #include // #include "lib/destroy.h" -// #include "lib/getattr.h" +#include "lib/getattr.h" // #include "lib/fgetattr.h" // #include "lib/access.h" // #include "lib/readlink.h" @@ -49,7 +49,7 @@ // #include "lib/lock.h" #include "lib/logger.h" -#include "lib/tree.h" +//#include "lib/tree.h" #include "lib/tar_structure.h" #include @@ -185,9 +185,9 @@ void* sifs_init(struct fuse_conn_info* conn) { } static struct fuse_operations sifs_oper = { - .init = sifs_init + .init = sifs_init, // .destroy = sifs_destroy, - // .getattr = sifs_getattr, + .getattr = sifs_getattr // .fgetattr = sifs_fgetattr, // .access = sifs_access, // .readlink = sifs_readlink, diff --git a/src/getattr.c b/src/getattr.c index 7a5d590..7e4f448 100644 --- a/src/getattr.c +++ b/src/getattr.c @@ -1,11 +1,17 @@ #include "../lib/getattr.h" -int sifs_getattr(const char* path, struct stat* sbuf) { - logger(DEBUG, "[init] Started\n"); +int _sifs_getattr(const char* path, struct stat* sbuf) { + return 0; +} +int sifs_getattr(const char* path, struct stat* sbuf) { + logger(DEBUG, "[getattr] Started\n"); + printf("caca\n"); + int ret; + ret = _sifs_getattr(path, sbuf); - logger(DEBUG, "[init] Ended\n"); - return -1; + logger(DEBUG, "[getattr] Ended\n"); + return ret; }