diff options
Diffstat (limited to 'src/ext/getattr.c')
-rw-r--r-- | src/ext/getattr.c | 102 |
1 files changed, 17 insertions, 85 deletions
diff --git a/src/ext/getattr.c b/src/ext/getattr.c index b6e0341..093cb9a 100644 --- a/src/ext/getattr.c +++ b/src/ext/getattr.c | |||
@@ -20,16 +20,28 @@ | |||
20 | 20 | ||
21 | int gn_getattr(const char *path, struct stat *stbuf) | 21 | int gn_getattr(const char *path, struct stat *stbuf) |
22 | { | 22 | { |
23 | int ret = 0; | 23 | |
24 | |||
25 | memset(stbuf, 0, sizeof(*stbuf)); | ||
26 | stbuf->st_mode = S_IFDIR | 0555; | ||
27 | stbuf->st_nlink = 1; | ||
28 | // stbuf->st_size = GNUNET_ECRS_uri_get_file_size(de->de_fi.uri); | ||
29 | |||
30 | |||
31 | |||
32 | |||
33 | |||
34 | |||
35 | /* int ret = 0; | ||
24 | //GNUNET_break (0); | 36 | //GNUNET_break (0); |
25 | memset(stbuf, 0, sizeof(struct stat)); | 37 | memset(stbuf, 0, sizeof(struct stat)); |
26 | 38 | ||
27 | if(strcmp(path, "/home/mg/gnunet-fuse5/gnunet-fuse/src/ext/mount") == 0) | 39 | if(strcmp(path, "") == 0) |
28 | { | 40 | { |
29 | stbuf->st_mode = S_IFDIR | 0755; | 41 | stbuf->st_mode = S_IFDIR | 0755; |
30 | stbuf->st_nlink = 1; // changed from 2 | 42 | stbuf->st_nlink = 1; // changed from 2 |
31 | } | 43 | } |
32 | 44 | */ | |
33 | 45 | ||
34 | /* | 46 | /* |
35 | else if(strcmp(path, directory) == 0) | 47 | else if(strcmp(path, directory) == 0) |
@@ -49,9 +61,9 @@ int gn_getattr(const char *path, struct stat *stbuf) | |||
49 | 61 | ||
50 | */ | 62 | */ |
51 | 63 | ||
52 | else return -ENOENT; | 64 | /* else return -ENOENT; |
53 | 65 | ||
54 | return ret; | 66 | return ret; */ |
55 | 67 | ||
56 | 68 | ||
57 | 69 | ||
@@ -59,83 +71,3 @@ int gn_getattr(const char *path, struct stat *stbuf) | |||
59 | } | 71 | } |
60 | 72 | ||
61 | 73 | ||
62 | |||
63 | |||
64 | |||
65 | |||
66 | |||
67 | |||
68 | |||
69 | |||
70 | |||
71 | |||
72 | |||
73 | |||
74 | |||
75 | |||
76 | |||
77 | |||
78 | |||
79 | |||
80 | |||
81 | |||
82 | |||
83 | |||
84 | |||
85 | |||
86 | |||
87 | |||
88 | |||
89 | |||
90 | |||
91 | |||
92 | |||
93 | |||
94 | /* | ||
95 | static const char *archive_path = "/"; | ||
96 | static const char *archive_str = "/Archive\n"; | ||
97 | |||
98 | static const char *britney_path = "/Britney Spears"; | ||
99 | static const char *britney_str = "Britney Spears\n"; | ||
100 | |||
101 | static const char *britney_br_path = "/Britney Spears/Britney"; | ||
102 | static const char *britney_br_str = "Britney\n"; | ||
103 | |||
104 | static const char *b_br_1_path = "/Britney Spears/Britney/I'm a Slave 4 U"; | ||
105 | static const char *b_br_1_str = "3:23 U\n"; | ||
106 | |||
107 | |||
108 | int gn_getattr(const char *path, struct stat *stbuf) | ||
109 | { | ||
110 | |||
111 | int res = 0; | ||
112 | |||
113 | memset(stbuf, 0, sizeof(struct stat)); | ||
114 | |||
115 | if(strcmp(path, "/") == 0) { //attr. fuer parent vz | ||
116 | stbuf->st_mode = S_IFDIR | 0755; | ||
117 | stbuf->st_nlink = 3; | ||
118 | } | ||
119 | |||
120 | else if(strcmp(path, britney_path) == 0) { //attr. fuer unterverzeichnis Britney | ||
121 | stbuf->st_mode = S_IFDIR | 0755; | ||
122 | stbuf->st_nlink = 3; | ||
123 | } | ||
124 | |||
125 | else if(strcmp(path, britney_br_path) == 0) { //Attribute fuer UnterUnterverzeichnis Britney | ||
126 | stbuf->st_mode = S_IFDIR | 0755; | ||
127 | stbuf->st_nlink = 1; | ||
128 | |||
129 | } | ||
130 | else if(strcmp(path, b_br_1_path) == 0 ){ //Songnummer 1 | ||
131 | stbuf->st_mode = S_IFREG | 0444; | ||
132 | stbuf->st_nlink = 1; | ||
133 | stbuf->st_size = strlen(b_br_1_str); | ||
134 | } | ||
135 | |||
136 | else res = -ENOENT; | ||
137 | |||
138 | return res; | ||
139 | } | ||
140 | |||
141 | */ | ||