toxicsoftware.com

RANDOMIZE USR 0

toxicsoftware.com header image 2

MacFUSE with Objective-C

January 16th, 2007 · Comments · Default

MacFUSE has been taking the Mac development community by storm. I’ve been hoping for a while that Fuse would get ported to Mac OS X, and Amit Singh fortunately obliged. I won’t bother elaborating on what MacFUSE is, Amit does a fine job of that himself, however I would like to present my Objective-C wrapper for MacFUSE:

http://toxic-public.googlecode.com/svn/tags/BlogTag_20070927_729/Projects/Projects/Misc/FuseTest/ (Subversion)

The code allows you to write a FUSE file system just by subclassing the CFileSystem class and providing concrete implementations for some or all of the CFileSystem’s methods.

The code is (as always) a work in a progress and about 3/4 of the FUSE operations have been wrapped as methods. Currently the code is missing all the extended attribute operations and a handful of other operations - but nothing crucial that should prevent a useful file system from being created.

To test my code I have created a “ShadowFS” file system that creates a file system that acts as a clone or shadow of a specified directory. The ShadowFS class is pretty short, currently just over 200 lines of code to implement a file system.

If you have MacFUSE installed (I installed it via the unofficial disk image at XXXX) then you should be able to checkout the “FuseTest” project, and build and run the “ShadowFS” target. This will create a mount point in “/tmp/ShadowFS_XXXXXXXX” and mount a volume called “Test” that is a copy of your “~/Movies” directory. A volume called “Test” (with a generic network share icon) should be mounted on your desktop. Ejecting the volume will allow the ShadowFS process to quit.

I hope this code can be used to jump start other people developing MacFUSE file systems and to help I’m releasing my code under the BSD license (the FUSE client library itself is under the LGPL). I’m hoping to see some cool Mac file systems in the near future and have a few good ideas myself.

I imagine there will be other Objective-C MacFUSE implementations soon but if anyone is interested in contributing to this project= please let me know.

Tags:

Viewing 7 Comments

blog comments powered by Disqus