MacFuse and Ruby fusefs extension

Posted on March 09, 2007

Lately I've been playing with MacFuse project and all I could say is that this is a fantastic effort of bringing the well-known user-space(fuse) file system to the OSX land. The latest versions of fuse work well with FreeBSD and MacFuse extends this functionality to OSX platform.

My goal was to make Ruby's fusefs extension play along with it. The major stumbling point was that MacFuse requires using the new fuse API, so I had to make several modifications to fusefs in order to make it possible at least to compile it.

OK. If you are a braveheart type and not afraid that it might damage your computer, these are the steps you need to do in order to install this extension:

  1. Download the latest version of MacFuse and use the installer that it comes with.

  2. Check out my version of fusefs from http://svn.datanoise.com/fusefs-osx and use the standard procedure of installing Ruby extensions:

    $ svn co http://svn.datanoise.com/fusefs-osx
    $ cd fusefs-osx
    $ make
    $ sudo make install
    

That's about it. Now you can start playing with examples located in <fusefs-osx>/sample directory. When you are at it, I'd like you to take a look at one of my personal toys - the remote DRb-based file system. It is located in <fusefs-osx>/sample/drb directory and that's how you use it:

  1. On the remote side (a Windows box will do just fine) start the drb server:

    $ ruby ./sample/drb/drbfs_server.rb ~/shared
    druby://myhost:7777
    

    The script takes the name of a directory you want to share. When the script is started, it'll print the URL you have to use when you mount your DRb filesystem on the client side.

  2. On the client side, mount DRb file system:

    $ ruby ./sample/drb/drbfs.rb mount/ druby://myhost:7777
    $ ls mount
    

    The client script takes the name of a directory you want to mount to and the URL of the server from the step one.

Enjoy and don't forget to read <fusefs-osx>/OSX.txt for the important API changes.

Profiling with Shark

Posted on January 26, 2007

Lately I ran into an article talking about a new Ruby debugger called Cylon. Developers of Sapphiresteel IDE have achieved remarkable results. The article stays that their debugger implementation imposes only 20% of an overhead over the standard Ruby interpreter. This is very impressive! I decided to try the same benchmark with ruby-debug and, to tell you the truth, I was kind of disappointed. It's time to profile...