by elehack · 15y ago · 0 comments
The file system stuff they were doing was incredible and highly useful. I'd really like to have a file system where I have indexed metadata committed directly with my file writes about now. Alas, since BeFS is dead, I pretty much have to roll my own with SQLite indexes alongside flat files. At the time, sure, it may look like no one has the problem, but if it would have become viable I think that we'd now be wondering how we lived without it.
Also, I note that when Giampaolo himself was implementing the subsequent metadata filing system that he worked on (Mac OS X 10.4+'s Spotlight feature), he went with a system-level metadata harvesting/indexing model where essentially all data (except for user-added Spotlight Comments, I think?) is wholly derived from the file itself by importers that are invoked by the system to populate its external indexed cache of metadata. That way, even if that central metadata database is blown away, it can be recreated at any time. This also allows interchange processes to only rely on what nearly always works across systems: the data itself and very basic metadata such as filename and creation/modified dates. And programs never have to worry about updating metadata aside from that which is internal to the file format.
[1] doesn't mean they don't exist (perhaps even BeOS, which I haven't used much) and I'd really like to hear about them, just talking about my own experience
[2] in this case, it can sometimes be even worse than a program wrongly blowing away the "resource fork" - a badly behaved program can update the file without updating its metadata, causing the metadata to be wrong!
On losing metadata: every modern filesystem in use supports extended attributes, so this shouldn't be a problem when copying files between BFS and NTFS, EXT4, btrfs, HFS+ or ZFS. The only filesystem that will cause problems is FAT32, which most people still use with USB drives. I don't know how that will be handled in Haiku.
With regard to most file systems supporting extended attributes: that's true (though FAT32 not supporting them is a huge caveat, and I also wouldn't be at all shocked to see some issues during conversion across FSes... I don't have personal experience though), but email, HTTP downloads, peer-to-peer, etc don't tend to support them, essentially guaranteeing you'll lose them if you transfer them across the Internet.
Also, it's really nice to not have to worry about, say, an EA-unaware POSIX app losing metadata... how many old-style Mac resource forks were lost during a simple file rename before mv was made resource fork-aware!
That's exactly what I mean. My version of index_server stored the index in a directory called "index" in the root of every volume it indexed. I'm not sure what the new one does.
Note that moving the index out of BFS was merely an idea that was bounced around the ML.
The BeOS mail application used the extended attributes extensively. Its mail store was basically a bunch of flat files containing the messages (perhaps in folders corresponding to the mail folders), and the extended attributes were used to index the date, sender, etc. These indices were then used to generate mail views, respond to searches, etc. - the mail app could effectively be a custom file system browser that used the extended attributes to speed itself up and quickly access and search mail metadata.