Skip to content

Commit

Permalink
Created files
Browse files Browse the repository at this point in the history
  • Loading branch information
Dummm committed Dec 26, 2018
1 parent 5cc5959 commit 2c6208e
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 7 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
CC = gcc
CFLAGS = -g -Wall `pkg-config fuse --cflags --libs` -D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=31

# typing 'make' will invoke the first target entry in the file
# typing 'make' will invoke the first target entry in the file
# (in this case the default target entry)
# you can name this target entry anything, but "default" or "all"
# are the most commonly used names by convention
Expand All @@ -25,7 +25,7 @@ default: sifs
# countwords.o, counter.o, and scanner.o:
#

sifs: sifs.o src/logger.o src/tree.o sifs.o
sifs: sifs.o src/logger.o src/tree.o
$(CC) $(CFLAGS) -o sifs src/logger.o src/tree.o sifs.o

# To create the object file countwords.o, we need the source
Expand All @@ -37,15 +37,15 @@ logger.o: src/logger.c lib/logger.h
# To create the object file counter.o, we need the source files
# counter.c and counter.h:
#
tree.o: src/tree.c lib/tree.h
tree.o: src/tree.c lib/tree.h
$(CC) $(CFLAGS) -c tree.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:
#
clean:
clean:
$(RM) sifs *.o *~
6 changes: 6 additions & 0 deletions lib/getattr.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef getattr_h
#define getattr_h
#include "../lib/logger.h"
#include <sys/stat.h>
int sifs_getattr(const char*, struct stat*);
#endif
Binary file added sifs
Binary file not shown.
16 changes: 14 additions & 2 deletions sifs.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
Build:
make
Run:
./sifs -f [file-path] [tar-path]
./sifs -f ./test ../Tars/testTar.tar
*/

//#define FUSE_USE_VERSION 26

#include <stdlib.h>
Expand Down Expand Up @@ -141,7 +149,7 @@ int populate_tree_directory(int fd, struct node *dir) {
}
// Function that prints tree
void print_tree(struct node *n) {
printf("%s\n", n->header->name);
logger(DEBUG, "\t%s\n", n->header->name);

int i;
for (i = 0; i < n->children_size; i++) {
Expand All @@ -165,8 +173,12 @@ void* sifs_init(struct fuse_conn_info* conn) {

// Creating tree for directory structure
populate_tree_directory(fd, root);

logger(DEBUG, "[init] Created directory tree\n");

logger(DEBUG, "[init] Tar directory structure:\n");
print_tree(root);


logger(DEBUG, "[init] Ended\n");
// Tree will be memorized in the context (fuse_get_context)
return root;
Expand Down
11 changes: 11 additions & 0 deletions src/getattr.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include "../lib/getattr.h"

int sifs_getattr(const char* path, struct stat* sbuf) {
logger(DEBUG, "[init] Started\n");



logger(DEBUG, "[init] Ended\n");
return -1;
}

0 comments on commit 2c6208e

Please sign in to comment.