Using MacFUSE on OSX: Part 2
In part one of my series on MacFUSE, I described what FUSE is and how it could fit into your daily Mac routine. Today, in part two, I will describe one of the more innovative and Mac-specific uses to emerge from the MacFUSE project.
SpotlightFS is one of the more interesting FUSE file systems developed for Mac OS X. It is also one of the first that was made available. SpotlightFS creates true Spotlight-driven smart folders, where the contents of the folders are generated on the fly. These are more powerful than the in-built OS X smart folders because they are actual folders. In OS X, the smart folders are actually XML files that run your Spotlight query when opened. The advantage of having actual folders is that they can be used from any other application, including the command line.
SpotlightFS can be obtained from the Downloads section of the MacFUSE web site. Once the disk image is installed, you should be able to use it immediately by launching SpotlightFS.app.
There are two fundamental methods of using SpotlightFS. The easiest way is to use “SmarterFolders” which, as the name suggests, are smarter than the smart folders that Mac OS X provides. These are folders that do not need to be created, just accessed, in order to view their contents. Once you are running SpotlightFS, click on Go->Open Folder in Finder and type in /Volumes/SpotlightFS/SmarterFolder/apple. This will bring you to a virtual folder that contains all the files returned by the Spotlight query “apple.” This allows you to use smart folders ad hoc, without having created them in advance, and to use them in a wide variety of applications. From the command line you can type:
ls -lrt /Volumes/SpotlightFS/SmarterFolder/apple
This will list all the files returned by the Spotlight query “apple.” If you are fluent with the command line, you can come up with many ways to perform bulk operations on similar files using SpotlightFS.
The second way to use SpotlightFS is to actually create a directory under /Volumes/SpotlightFS with the search-string you are interested in. For example, you can create a directory called “Apple Hacks” which will behave similarly to smart folders in OS X, but as a real folder. At the command line, you can type:
mkdir /Volumes/SpotlightFS/Apple Hacks/
ls -lrt /Volumes/SpotlightFS/Apple\ Hacks/
FUSE provides many ways of making data more useful and accessible, in addition to providing implementations to file systems that have historically not been supported under Mac OS X. While experimenting with virtual file systems is fairly harmless, make sure you have backed up your data and read the instructions carefully before you use fully functional file systems such as ntfs-3g.
Next time, in part three of the series on MacFUSE, I will discuss other installation and use of other nifty file systems such as GMailFS to mount your GMail storage as an external volume and WikipediaFS to edit Wikipedia as if it were mounted locally on your Mac.
Comments
In more technical terms, MacFUSE implements a mechanism that makes it possible to implement a fully functional file system in a user-space program on Mac OS X. It provides multiple APIs, one of which is a superset of the FUSE API that originated on Linux. Therefore, many existing FUSE file systems become readily usable on Mac OS X.-Jonathan Berkowitz