minor fixes
authorMiklos Szeredi <miklos@szeredi.hu>
Fri, 21 Dec 2001 09:28:33 +0000 (09:28 +0000)
committerMiklos Szeredi <miklos@szeredi.hu>
Fri, 21 Dec 2001 09:28:33 +0000 (09:28 +0000)
README.python [deleted file]
configure.in
example/hello.c
python/README [new file with mode: 0644]

diff --git a/README.python b/README.python
deleted file mode 100644 (file)
index 451c56c..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-General Information
-===================
-
-This is a Python[1] interface to FUSE[2].
-
-FUSE (Filesystem in USErspace) is a simple interface for userspace
-programs to export a virtual filesystem to the linux kernel.  FUSE
-also aims to provide a secure method for non privileged users to
-create and mount their own filesystem implementations.
-
-When run from the commandline, "fuse.py" simply reexports the root
-filesystem within the mount point as example/fusexmp does in the main
-FUSE distribution.  It also offers a class, fuse.Fuse, which can be
-subclassed to create a filesystem.  fuse.Xmp is the example filesystem
-implementation.
-
-In your subclass of fuse, add attributes with the expected names
-("getattr", "readlink", etc) and call signatures (refer to fuse.Xmp)
-then call main().  Make it runnable as a #! script, and mount with
-       fusermount <mount point> <script name>
-for some reason,
-       fusermount <mount point> python <script name>
-does not seem to work. (why?)
-
-Limitations
-===========
-
-This is minimally tested, though I think I have exercised each function.
-There's no documentation, docstrings, or tests.
-
-Python's lstat() does not return some fields which must be filled in
-(st_blksize, st_blocks, st_ino), and _fusemodule assumes that the return
-value from the lstat() method is identical to Python's lstat().  This
-limitation should be lifted, and some standard order chosen for these
-three values.  For now, though, default values are chosen and du returns a
-number similar to the "real" one.
-
-The Python Global Interpreter Lock is not handled, so using
-fuse.MULTITHREAD will not work.  Modifying the PROLOGUE and EPILOGUE
-functions may take care of this.  For now, just run without
-fuse.MULTITHREAD in flags.
-
-Author
-======
-
-I'm Jeff Epler <jepler@unpythonic.dhs.org>.  I've been dabbling in
-Python for nearly 7 years now, and interested (despite the lack of a
-real practical use) in userspace filesystems ever since I couldn't get
-userfs to compile way back in '93 or so.  FUSE is cool, but i'm still
-not sure what it's good for in practical terms.
-
-I don't know how high a level of interest I'll maintain in this project,
-so if you want to do something with it feel free to do so.  Like FUSE,
-this software is distributed under the terms of the GNU General Public
-License, Version 2.  Future versions, if any, will be available at [3].
-
-
-[1] http://www.python.org
-[2] http://sourceforge.net/projects/avf/
-[3] http://unpythonic.dhs.org/~jepler/fuse/
index 6a0b1bdfa3ff58e0463d6989f968c62a05ff4752..a6f94c8fdb9654673ff73c49715ddea1b6ed1fa9 100644 (file)
@@ -1,5 +1,5 @@
 AC_INIT(lib/fuse.c)
-AM_INIT_AUTOMAKE(fuse, 0.9)
+AM_INIT_AUTOMAKE(fuse, 0.95)
 AM_CONFIG_HEADER(include/config.h)
 
 AC_PROG_CC
index 5cf75f47013859c0d528c47941466d8fb0e38ad2..e0010cd92722d99da00f37f06a531730a6333953 100644 (file)
@@ -12,6 +12,7 @@
 #include <fcntl.h>
 
 static const char *hello_str = "Hello World!\n";
+static const char *hello_path = "/hello";
 
 static int hello_getattr(const char *path, struct stat *stbuf)
 {
@@ -22,8 +23,8 @@ static int hello_getattr(const char *path, struct stat *stbuf)
         stbuf->st_mode = S_IFDIR | 0755;
         stbuf->st_nlink = 2;
     }
-    else if(strcmp(path, "/hello") == 0) {
-        stbuf->st_mode = S_IFREG | 0644;
+    else if(strcmp(path, hello_path) == 0) {
+        stbuf->st_mode = S_IFREG | 0444;
         stbuf->st_nlink = 1;
         stbuf->st_size = strlen(hello_str);
     }
@@ -40,14 +41,14 @@ static int hello_getdir(const char *path, fuse_dirh_t h, fuse_dirfil_t filler)
 
     filler(h, ".", 0);
     filler(h, "..", 0);
-    filler(h, "hello", 0);
+    filler(h, hello_path + 1, 0);
 
     return 0;
 }
 
 static int hello_open(const char *path, int flags)
 {
-    if(strcmp(path, "/hello") != 0)
+    if(strcmp(path, hello_path) != 0)
         return -ENOENT;
 
     if((flags & 3) != O_RDONLY)
@@ -58,14 +59,14 @@ static int hello_open(const char *path, int flags)
 
 static int hello_read(const char *path, char *buf, size_t size, off_t offset)
 {
-    if(strcmp(path, "/hello") != 0)
+    if(strcmp(path, hello_path) != 0)
         return -ENOENT;
     
     memcpy(buf, hello_str + offset, size);
     return size;
 }
 
-static struct fuse_operations null_oper = {
+static struct fuse_operations hello_oper = {
     getattr:   hello_getattr,
     readlink:  NULL,
     getdir:     hello_getdir,
@@ -87,6 +88,6 @@ static struct fuse_operations null_oper = {
 
 int main(int argc, char *argv[])
 {
-    fuse_main(argc, argv, &null_oper);
+    fuse_main(argc, argv, &hello_oper);
     return 0;
 }
diff --git a/python/README b/python/README
new file mode 100644 (file)
index 0000000..451c56c
--- /dev/null
@@ -0,0 +1,60 @@
+General Information
+===================
+
+This is a Python[1] interface to FUSE[2].
+
+FUSE (Filesystem in USErspace) is a simple interface for userspace
+programs to export a virtual filesystem to the linux kernel.  FUSE
+also aims to provide a secure method for non privileged users to
+create and mount their own filesystem implementations.
+
+When run from the commandline, "fuse.py" simply reexports the root
+filesystem within the mount point as example/fusexmp does in the main
+FUSE distribution.  It also offers a class, fuse.Fuse, which can be
+subclassed to create a filesystem.  fuse.Xmp is the example filesystem
+implementation.
+
+In your subclass of fuse, add attributes with the expected names
+("getattr", "readlink", etc) and call signatures (refer to fuse.Xmp)
+then call main().  Make it runnable as a #! script, and mount with
+       fusermount <mount point> <script name>
+for some reason,
+       fusermount <mount point> python <script name>
+does not seem to work. (why?)
+
+Limitations
+===========
+
+This is minimally tested, though I think I have exercised each function.
+There's no documentation, docstrings, or tests.
+
+Python's lstat() does not return some fields which must be filled in
+(st_blksize, st_blocks, st_ino), and _fusemodule assumes that the return
+value from the lstat() method is identical to Python's lstat().  This
+limitation should be lifted, and some standard order chosen for these
+three values.  For now, though, default values are chosen and du returns a
+number similar to the "real" one.
+
+The Python Global Interpreter Lock is not handled, so using
+fuse.MULTITHREAD will not work.  Modifying the PROLOGUE and EPILOGUE
+functions may take care of this.  For now, just run without
+fuse.MULTITHREAD in flags.
+
+Author
+======
+
+I'm Jeff Epler <jepler@unpythonic.dhs.org>.  I've been dabbling in
+Python for nearly 7 years now, and interested (despite the lack of a
+real practical use) in userspace filesystems ever since I couldn't get
+userfs to compile way back in '93 or so.  FUSE is cool, but i'm still
+not sure what it's good for in practical terms.
+
+I don't know how high a level of interest I'll maintain in this project,
+so if you want to do something with it feel free to do so.  Like FUSE,
+this software is distributed under the terms of the GNU General Public
+License, Version 2.  Future versions, if any, will be available at [3].
+
+
+[1] http://www.python.org
+[2] http://sourceforge.net/projects/avf/
+[3] http://unpythonic.dhs.org/~jepler/fuse/