seralize my thoughts into posts

Archive for November, 2010

Ruby’s Backwards compatibility and Alef-FS

What is the 1st thing I  need to do in order to implement Alef-FS ? have RFuse-ng installed on my machine as a ruby gem.

RFuse-ng is a bridge between ruby and FUSE. The concept is very similar to Java JNI, which mean that it is mainly a native code written in “C”

RFuse-ng comes with a REDAME which is good, and it has a Makefle which is even better, but it also has several compilation errors – not good.

While reading the docs I find out why –  RFuse-ng was tested with ruby 1.8 and I’m using 1.9.2. Further investigation of the code made me realize that ruby does not have Backwards compatibility, at least not in the aspect of native code support.

As Michael Feathers wrote in Working Effectively with Legacy Codelegacy code is code without tests” I understood that it is not going to be fun.

I had to tackle issues mainly due to changes in the way ruby exposes its string representation to “C” code. #define rules!!!!!!

Anyway, at the end of the road I’ve managed to create a patch file for  RFuse-ng describing the changes required to make it work  under ruby 1.9.2

Now, all I have to do now is to implement, (at least until the next obstacle)

class AlephFS < RFuse::Fuse
# implement

Aleph-FS when desktop serach meets FUSE


Desktop search tools, like tracker, beagle (R.I.P), Google desktop —  are all very useful.

The interface of a desktop search is great when all you need is to open the file (you searched for)  — 2 clicks, typing a search query, and you have it.

But what happens when you need the path of the file ? There are applications that must have the exact path (location + file name), for example:

  • command line utilities: cp, tar, zip, …
  • file chooser window: when you want to attach a file into email web client (Gmail)


  • People need to manage a large amount of  files (documents, pictures, songs, videos) –>  Desktop search tools are very powerful and popular –> more people follow the “search, don’t sort!” concept –> file system’s structures are more flat
  • The browser is the most common application we use. the browser  accesses  the local file system using file chooser window.

The Problem

There is no  integration between Desktop search tools and applications that require file paths

The Solution

Aleph-FS project’s goal is to implement a file system interface to Desktop search tools. Browsing Aleph-FS  (virtual) file system will actually perform search operation on your real (physical) file system.

Why file system interface ?

  • “Search is the new Browse” — so search should have the same interface you have when you browse your files.
  • A file system is the intuitive interface for file handling

Aleph is the fist Hebrew letter. Aleph-FS  pronounced as “Aleph Ef Es” which is the origin of  the term Aleph Number (represents the cardinality  of infinite sets).

Alef ef es

Scenario – what you have now

  • You want to send a mail, using Gmail (for example).
  • You want to attach a file – (for example – mp3 song called “3 days” of your favorite performer Yehuda Poliker )
  • You don’t remember where you put the file
  • You open your desktop search interface (double Ctrl for Google Desktop)
  • You type: “mp3 Poliker 3 days”
  • You easily find the file, you right-click it, and choose “open containing folder”
  • You find the containing folder, and copy it path
  • You switch back to Gmail, and click browse button
  • You paste in the folder’s path (location + name)
  • You choose the correct mp3 file from all the files inside this folder

How it will work with Aleph-FS

  • In Gmail, click on browse button
  • In the file chooser window, type /search/mp3/poliker/3 days/as the folder name
  • the “3 days.mp3” appears as a file under this folder
  • You click on it  — end of story

an example how the serach file system will work


The idea is to expose the desktop search query interface  as a read only file system using FUSE.

FUSE stands for “filesystem in a userspace”. You can develop your own file system using its API.

The implementation will need to:

  • convert each path into a query
  • send the query to the desktop search (could be more than one)  using API
  • get back the query result and dynamically add files to the content of the path

FUSE supports several languages and I think I will implement it in ruby.


Aleph-FS project will be managed in github

%d bloggers like this: