From: Alexandros S. <al...@gm...> - 2008-07-13 18:30:43
|
Hi all, This is a status update for the Tcl-Fuse project (https://sourceforge.net/projects/tcl-fuse). For those that don't know what tcl-fuse is: It's a Tcl interface to the linux kernel's FUSE subsystem. It provides a Tcl extension that exports the full functionality of the underlying FUSE kernel feature to the Tcl programming language. FUSE, which stands for File-System in User-Space, is a kernel subsystem and accompanying library that allows regular programs to implement a filesystem completely in userspace. The filesystem operations are received by the kernel via the standard Linux VFS interface, and are dispatched to a resident user process for handling (daemon). This extension will enable for: * Easy creation of FUSE filesystem written solely in Tcl * Export of the Tcl VFS via FUSE for all system processes to take advantage. THE DESIGN: The entry point is a new Tcl command named "fuse". This command establishes a binding between FUSE operations and Tcl procedures. It creates a new command for every FUSE filesystem, that can be used to mount it on a specific filesystem directory. There is a proxy C function for every FUSE operation. The proxy function is invoked by FUSE and its job is to translate the C API to a Tcl API, and vice versa for the return value of the Tcl procedure. Currently the level of integration with FUSE is low. This will be improved in due course. For instance, mount parameters are parsed by FUSE, whereas the FUSE events are not handled by Tcl's event loop (which remains stalled). CURRENT STATUS: * Created a TEA build tree and adapted it for the needs of this Project. * Completed a first version of the extension with support for the "getattr", "readdir", "read", "open" and "rename" FUSE operations. * Ported the example hello FUSE filesystem (examples/hello.c in FUSE's source tree) to Tcl (examples/hello.tcl in tcl-fuse's source). * Created a preliminary TclVFS to FUSE Tcl interface (examples/fusevfs.tcl in tcl-fuse's source), that is limited to the aforementioned FUSE operations. WHAT'S COMING NEXT: * Implement the proxy functions for the remaining FUSE operations. * Implement a few subcommands for the "fuse" command, namely: version, unmount, info, context * Create Tcl cleanup procedures to automatically erase state. * Integration of FUSE events to Tcl's event loop and threading model. * Complete the FuseVFS extension. * Documentation (man page). TO FETCH svn checkout https://tcl-fuse.svn.sourceforge.net/svnroot/tcl-fuse TO COMPILE On 32bit: autoconf ./configure --prefix=/usr/local make sudo make install On 64bit systems: autoconf PKG_CFLAGS="-D_FILE_OFFSET_BITS=64" \ ./configure --with-tcl=/usr/lib64 make sudo make install Detailed instructions in README.tclfuse. REQUIREMENTS: * Kernel with FUSE enabled (CONFIG_FUSE_FS) * Tcl 8.5 TO TRY IT OUT: To mount the "hello" filesystem: cd <root of source code tree> tclsh examples/hello.tcl To mount the FuseVFS filesystem that maps the root of Tcl's VFS: cd <root of source code tree> tclsh examples/test_fusevfs.tcl In both cases the examples/mnt directory is where the filesystems will get mounted. I'm looking forward to feedback. Alexandros |