I started playing with #camlistore  about a week and a half ago.  It was my introduction to FUSE (I think I'd run sshfs once and decided it wasn't useful to me).

My big project last weekend (~3 days in) was time travel, which is pretty awesome, but basically built on mostly on concepts that already existed (a little API additions here and there and some FUSE work).  Someday, we'll all forget those dark times when you couldn't look at last week's home directory (and old plan9 users will remember them).

This weekend, I thought I'd add extended attribute support.  Dragging files into Finder windows would show it trying to create AppleDouble files (._yourfile.png) as a way to stash arbitrary attributes onto files.  It's weird and unpleasant, so implementing xattr directly seemed like it'd be a quick way to tidy this up.

It's hard.

There was a sketch in the camlistore schema docs for where xattr might go, but as a normal unix user, I don't think about them much and I tend to think I'm not alone there, so I'm guessing it was a fairly low priority task.  So I got to learn all kinds of schema, client, and indexing interactions to figure out how to even communicate this information (and didn't have to modify the schema or index to do so, which is a sign of great design).

However, the FUSE API did not have any of the xattr mechanisms (getxattr, setxattr, listxattr, removexattr) implemented.  As it turns out, the retrieval ones are particularly special in that they have two response formats.  The best documentation I found for it was here:  https://github.com/osxfuse/fuse/blob/fuse-2.7/lib/fuse.c#L2784-L2821

So getting those commands read and processed was most of yesterday.  Today was making the change as unimpressively small as I could while applying it more broadly.  It's still not perfect (e.g. I can make FUSE forcefully eject my filesystem and exit successfully with no warning messages logged anywhere on demand) and I've still got a lot of stuff to learn, but I rarely have fun when I'm not what I'm doing.

You can combine xattrs and time travel for neat effects.  e.g. I can take this window back in time before I labeled and arranged the icons.  Before I accidentally did a "clean up" or "sort by" or whatever.  That's pretty awesome.
Photo
Shared publiclyView activity