[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r20634 - gnunet-fuse/src/ext
From: |
gnunet |
Subject: |
[GNUnet-SVN] r20634 - gnunet-fuse/src/ext |
Date: |
Tue, 20 Mar 2012 16:27:38 +0100 |
Author: mauricio
Date: 2012-03-20 16:27:38 +0100 (Tue, 20 Mar 2012)
New Revision: 20634
Modified:
gnunet-fuse/src/ext/getattr.c
gnunet-fuse/src/ext/gnunet-fuse.c
gnunet-fuse/src/ext/open.c
gnunet-fuse/src/ext/read.c
gnunet-fuse/src/ext/readdir.c
Log:
-changes
Modified: gnunet-fuse/src/ext/getattr.c
===================================================================
--- gnunet-fuse/src/ext/getattr.c 2012-03-20 14:37:29 UTC (rev 20633)
+++ gnunet-fuse/src/ext/getattr.c 2012-03-20 15:27:38 UTC (rev 20634)
@@ -20,17 +20,29 @@
int gn_getattr(const char *path, struct stat *stbuf)
{
- int ret = 0;
+
+
+ memset(stbuf, 0, sizeof(*stbuf));
+ stbuf->st_mode = S_IFDIR | 0555;
+ stbuf->st_nlink = 1;
+ // stbuf->st_size = GNUNET_ECRS_uri_get_file_size(de->de_fi.uri);
+
+
+
+
+
+
+ /* int ret = 0;
//GNUNET_break (0);
memset(stbuf, 0, sizeof(struct stat));
- if(strcmp(path, "/home/mg/gnunet-fuse5/gnunet-fuse/src/ext/mount") == 0)
+ if(strcmp(path, "") == 0)
{
stbuf->st_mode = S_IFDIR | 0755;
stbuf->st_nlink = 1; // changed from 2
}
+*/
-
/*
else if(strcmp(path, directory) == 0)
{
@@ -49,9 +61,9 @@
*/
- else return -ENOENT;
+/* else return -ENOENT;
- return ret;
+ return ret; */
@@ -59,83 +71,3 @@
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-/*
-static const char *archive_path = "/";
-static const char *archive_str = "/Archive\n";
-
-static const char *britney_path = "/Britney Spears";
-static const char *britney_str = "Britney Spears\n";
-
-static const char *britney_br_path = "/Britney Spears/Britney";
-static const char *britney_br_str = "Britney\n";
-
-static const char *b_br_1_path = "/Britney Spears/Britney/I'm a Slave 4 U";
- static const char *b_br_1_str = "3:23 U\n";
-
-
-int gn_getattr(const char *path, struct stat *stbuf)
-{
-
-int res = 0;
-
- memset(stbuf, 0, sizeof(struct stat));
-
- if(strcmp(path, "/") == 0) { //attr. fuer parent vz
- stbuf->st_mode = S_IFDIR | 0755;
- stbuf->st_nlink = 3;
- }
-
- else if(strcmp(path, britney_path) == 0) { //attr. fuer
unterverzeichnis Britney
- stbuf->st_mode = S_IFDIR | 0755;
- stbuf->st_nlink = 3;
- }
-
- else if(strcmp(path, britney_br_path) == 0) { //Attribute fuer
UnterUnterverzeichnis Britney
- stbuf->st_mode = S_IFDIR | 0755;
- stbuf->st_nlink = 1;
-
- }
- else if(strcmp(path, b_br_1_path) == 0 ){ //Songnummer 1
- stbuf->st_mode = S_IFREG | 0444;
- stbuf->st_nlink = 1;
- stbuf->st_size = strlen(b_br_1_str);
- }
-
- else res = -ENOENT;
-
- return res;
-}
-
-*/
Modified: gnunet-fuse/src/ext/gnunet-fuse.c
===================================================================
--- gnunet-fuse/src/ext/gnunet-fuse.c 2012-03-20 14:37:29 UTC (rev 20633)
+++ gnunet-fuse/src/ext/gnunet-fuse.c 2012-03-20 15:27:38 UTC (rev 20634)
@@ -111,6 +111,7 @@
return;
}
+ printf("%s\n", directory);
/* checking for muti- or singlethreading */
if (GNUNET_YES == TESTING)
@@ -152,6 +153,9 @@
&GNUNET_GETOPT_set_string, &directory},
GNUNET_GETOPT_OPTION_END };
+
+
+
return (GNUNET_OK ==
GNUNET_PROGRAM_run2(argc,
argv,
Modified: gnunet-fuse/src/ext/open.c
===================================================================
--- gnunet-fuse/src/ext/open.c 2012-03-20 14:37:29 UTC (rev 20633)
+++ gnunet-fuse/src/ext/open.c 2012-03-20 15:27:38 UTC (rev 20634)
@@ -35,7 +35,7 @@
{
- if (strcmp(path, "/home/mg/gnunet-fuse5/gnunet-fuse/src/ext/mount") |
strcmp(path, "/") == 0)
+ if (strcmp(path, "/home/mg/gnunet-fuse2/gnunet-fuse/src/ext/monti") ==
0)
return 0;
else if ((fi->flags & 3) != O_RDONLY)
@@ -48,61 +48,3 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-/*
-static const char *archive_path = "/";
-static const char *archive_str = "/Archive\n";
-
-static const char *britney_path = "/Britney Spears";
-static const char *britney_str = "Britney Spears\n";
-
-static const char *britney_br_path = "/Britney Spears/Britney";
-static const char *britney_br_str = "Britney\n";
-
-static const char *b_br_1_path = "/Britney Spears/Britney/I'm a Slave 4 U";
- static const char *b_br_1_str = "3:23 U\n";
-
-
- if((strcmp(path, archive_path) | strcmp(path, britney_path) |
strcmp(path, britney_br_path))==0)
- // return -ENOENT;
- return 0;
-
- else if ( (fi->flags & 3) != O_RDONLY )
- return -EACCES;
-
- else return 0;
-
-
-
-*/
Modified: gnunet-fuse/src/ext/read.c
===================================================================
--- gnunet-fuse/src/ext/read.c 2012-03-20 14:37:29 UTC (rev 20633)
+++ gnunet-fuse/src/ext/read.c 2012-03-20 15:27:38 UTC (rev 20634)
@@ -30,15 +30,19 @@
struct fuse_file_info *fi)
{
size_t len;
- if (strcmp(path, "/home/mg/gnunet-fuse5/gnunet-fuse/src/ext/mount") ==
0)
+
+//until now read-function isn't used....
+
+
+/* if (strcmp(path, "") == 0)
{
- len = strlen("/home/mg/gnunet-fuse5/gnunet-fuse/src/ext/mount");
+ len = strlen("");
if (offset < len)
{
if (offset + size > len)
size = len - offset;
- memcpy(buf, "/" + offset, size);
+ memcpy(buf, "" + offset, size);
}
else
size = 0;
@@ -46,131 +50,9 @@
return size;
}
+*/
-
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-/*
- *
- *
-
-static const char *archive_path = "/";
-static const char *archive_str = "/Archive\n";
-
-static const char *britney_path = "/Britney Spears";
-static const char *britney_str = "Britney Spears\n";
-
-static const char *britney_br_path = "/Britney Spears/Britney";
-static const char *britney_br_str = "Britney\n";
-
-static const char *b_br_1_path = "/Britney Spears/Britney/I'm a Slave 4 U";
- static const char *b_br_1_str = "3:23 U\n";
-
-
-
-
-size_t len;
- (void) fi;
-
-
- if (strcmp(path, archive_path) == 0)
- {
- len = strlen(archive_str);
- if (offset < len)
- {
- if (offset + size > len)
- size = len - offset;
- memcpy(buf, archive_str + offset, size);
- }
- else
- size = 0;
-
- return size;
- }
-
-
- else if(strcmp(path, britney_path) == 0)
- {
- len = strlen(britney_str);
- if (offset < len) {
- if (offset + size > len)
- size = len - offset;
- memcpy(buf, britney_str + offset, size);
- }
- else
- size = 0;
-
- return size;
- }
-
- else if(strcmp(path, britney_br_path) == 0) // ab hier das
verzeichnis britney spears
- {
- len = strlen(britney_br_str);
- if (offset < len) {
- if (offset + size > len)
- size = len - offset;
- memcpy(buf, britney_br_str + offset, size);
- }
- else
- size = 0;
-
- return size;
- }
-
- else if(strcmp(path, b_br_1_path) == 0) // ab hier album
Britney-Lied1
- {
- len = strlen(b_br_1_str);
- if (offset < len)
- {
- if (offset + size > len)
- size = len - offset;
- memcpy(buf, b_br_1_str + offset, size);
- }
- else
- size = 0;
-
- return size;
- }
- else return -ENOENT;
-
-*/
Modified: gnunet-fuse/src/ext/readdir.c
===================================================================
--- gnunet-fuse/src/ext/readdir.c 2012-03-20 14:37:29 UTC (rev 20633)
+++ gnunet-fuse/src/ext/readdir.c 2012-03-20 15:27:38 UTC (rev 20634)
@@ -51,28 +51,15 @@
//int len = strlen(directory);
// GNUNET_asprintf();
- if (strcmp(path, "/home/mg/gnunet-fuse5/gnunet-fuse/src/ext/mount") ==
0)
- {
- filler(buf, ".", NULL, 0);
- filler(buf, "..", NULL, 0);
- filler(buf,
"/home/mg/gnunet-fuse5/gnunet-fuse/src/ext/mount"+1, NULL, 0);
- return 0;
- }
- /*
-
- else if (strcmp(path, directory) == 0) // mounted directory with
content
- {
filler(buf, ".", NULL, 0);
filler(buf, "..", NULL, 0);
- filler(buf, track+len, NULL, 0); // path to directory mal
- return 0;
- }
+ //filler(buf, "/home/mg/gnunet-fuse2/gnunet-fuse/src/ext/monti"+1,
NULL, 0);
+ //return 0;
- */
- else return -ENOENT;
+
}
@@ -84,73 +71,3 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-/*
-
-static const char *archive_path = "/";
-static const char *archive_str = "/Archive\n";
-
-static const char *britney_path = "/Britney Spears";
-static const char *britney_str = "Britney Spears\n";
-
-static const char *britney_br_path = "/Britney Spears/Britney";
-static const char *britney_br_str = "Britney\n";
-
-static const char *b_br_1_path = "/Britney Spears/Britney/I'm a Slave 4 U";
- static const char *b_br_1_str = "3:23 U\n";
-
-
-
-if(strcmp(path, "/") == 0)
- {
- filler(buf, ".", NULL, 0);
- filler(buf, "..", NULL, 0);
-
- filler(buf, britney_path + 1, NULL, 0);
- //filler(buf, metallica_path + 1, NULL, 0);
- return 0;
- }
-
- else if(strcmp(path, "/Britney Spears") == 0)
- {
- filler(buf, ".", NULL, 0);
- filler(buf, "..", NULL, 0);
- //filler(buf, britney_omt_path + 16, NULL, 0);
- filler(buf, britney_br_path + 16, NULL, 0);
- return 0;
- }
-
- else if(strcmp(path, britney_br_path) == 0) // ab hier das
album britney
- {
- filler(buf, ".", NULL, 0);
- filler(buf, "..", NULL, 0);
- filler(buf, b_br_1_path + 24 , NULL, 0);
-
- return 0;
- }
-
- else return -ENOENT;
-
-
-
-*/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r20634 - gnunet-fuse/src/ext,
gnunet <=