Distributed under the LGPL license, see COPYING for details.
By using FUSE, the C# code can run entirely in user-space and not require any special permissions to serve the filesystem.
SULF is meant to be useful to filesystem developers. It currently contains only a simple test filesystem to use for testing.
2005.04.29 -- 0.3, Queen's Day release
2005.01.15
2005.01.13
To get the current distribution:
darcs get http://arg0.net/users/vgough/devel/sulf cd sulf darcs get http://arg0.net/users/vgough/devel/RLog autoreconf ./configure make
An easier way to get started is to use the snapshot, which contains pre-built objects: sulf-0.3.tar.gz.
See also Dependencies , and Getting Started
My first attempt at building a C# wrapper for fuse was based on capturing all the callbacks from libfuse in C code, and then have a conversion layer translate that into calls to C# code (using internal Mono C# API). This worked, but had some downsides:
The new way
The current method is significantly different. The C# code takes control immediately and talks directly to the FUSE kernel module with the help of a some C code (and wrappers generated automatically by SWIG).
This no longer requires the use of Mono internal API's, and it also allows the filesystem to run multi-threaded. The downside is that the FUSE kernel interface has been more variable then the libfuse interface, which means that the C# interface will work with fewer versions of the FUSE code tree.
The build scripts for FuseWrapper try to automate the process of converting from a fuse_kernel.h (fuse kernel header file) into a set of C# classes.
Only Fuse 2.3 (kernel API 6.1) is supported. The communication with the Fuse kernel module consists of sending and receiving various C structs. FuseWrapper deals with this by keeping the reading and writing of the struct in C code, with wrappers for C# generated by SWIG.
Implementing a filesystem using Fuse.dll requires implementing three sets of interfaces. These interfaces correspond to the type of function calls that they will handle: filesystem level, directory level, and file level.
1. Fuse.FileSystem interface, which defines a Stat operation and a means of getting the top level directory.
2. Fuse.DirNode interface, which is used for access to directories (one of which is returned by the filesystem level -- FileSystem.RootNode):
3. Fuse.FileNode interface is used for access to normal files
In addition to this three way split, the DirNode and FileNode interfaces also come in two flavors -- one for read-only objects, and another with write support. The Fuse.dll dispatch handler knows how to treat a file based on the interfaces it implements. For example, if a DirNode returns an object which implements FileNode (but not MutableFileNode), then the file will be read-only.
The Sulf.dll design is meant to translate from the Fuse.dll api into something more transparent to C# objects. This layer is newer and is in development.
TODO: more to come. See examples and Sulf directories.
FUSE (Filesystem in User SpacE): http://sourceforge.net/projects/fuse
Version 2.3 (or pre-2.3 from CVS) is the only tested version
Mono (C# compiler and runtime): http://go-mono.org
Mono 1.1.7 is known to work, older versions may or may not work. 1.0.6 is known to NOT work due to some problem passing a delegate as a method argument. 1.1.6 has a bug (#74773) which causes incorrect code to be produced, causing strange runtime behavior.
SWIG (Simplified Wrapper and Interface Generator): http://www.swig.org/
Must use SWIG >= 1.3.24. SWIG's C# output has been maturing recently, and SULF will not build with earlier versions of SWIG..
./configure make cd examples make run # run hello-fs example which mounts to /tmp/hellofs
1.4.3