Skip to contentSkip to conversation

File as a directory - file-as-dir vs. link-dirs (again) - 3/3

DISCUSSION Alexander G. M. Smith 2 participants 2 messages Nov 19, 2005 – Dec 8, 2005

lore
Share & tools
lore
#0 lore raw

Leo Comerford wrote on Fri, 18 Nov 2005 03:42:50 +0000:

Quoted 1 line

[^.*$]

Just a few points I thought of while reading through your text:

Genealogy is an extremely structured arrangement of data, most people won't be doing something that complex - think of photo filing instead. Also cycles exist everywhere, even in genealogy. So cycles should be supported by default.

You had a separate directory storing relationship links. How about making that a subdirectory of the person? If I wanted to do genealogy-as-a-file-system, I'd have a "children" subdirectory under the person; it would contain hard links to all the person's children. If you want to find a person's mother or father, examine the list of their parent directories (a cyclic file system has more parents than just "..") to find the ones called "children". The person's parents are the holders of those "children" directories.

I wouldn't worry about naming conflicts (such as "children" being a magic name) since most people only define a few dozen relationships, at least in BeOS. E-mail was the most complex, followed by MP3 audio and photo tagging and not too much else. So just stick a prefix on the Children directory to mark it as special, or mark it with a special file type (a subclass of directory in Apple's new typing scheme). BeOS used a short prefix, like "MAIL:" so you'd have "MAIL:subject" and "MAIL:from" as e-mail attribute names (though that's actually bad, since news articles have subjects too).

Admittedly one difficulty is in representing tuples. And double ended links. Like the Friendship relation. BeOS handled that by tagging things with group names, and then indexing the tags. So e-mail contacts all had a "META:group" attribute containing a comma separated list of group names. The BeOS indexed attribute query engine could then quickly turn up all contacts belonging to a particular group. Though finding a list of all groups wasn't as elegant. Which reminds me that attribute-like things should include arrays, with global indexing support to find things inside an array (also useful for arrays of keywords in word processing documents).

So to sum up, it seems that you're way more power hungry than I. I just want something to make finding photos easier, not a whole database equivalent system (I'd use a database for that). Early versions of BeOS did use a database as the file system, which turned out to be more trouble than it was worth. A file system can and perhaps should be something lighter. But not as lightweight as plain Unix file systems - I want better searching and linking.

- Alex

#1 lore raw
Quoted 8 lines · Alexander G. M. Smith

Leo Comerford wrote on Fri, 18 Nov 2005 03:42:50 +0000:

Quoted 1 line

[^.*$]

Just a few points I thought of while reading through your text:

Genealogy is an extremely structured arrangement of data, most people won't be doing something that complex - think of photo filing instead. Also cycles exist everywhere, even in genealogy. So cycles should be supported by default.

Cycles? Sure. Hence all the quibbling about the generic "tree" operators actually being rooted directed graph operators.

(In the case of geneaology, parent-child digraphs are acyclic unless they involve Beeblebroxes, though they're *shudder* not invariably /trees/.)

It's true that a lot of file metadata doesn't involve recursive structure or suchlike, but you don't have to get very advanced or esoteric to find file metadata that does. Expose your email's
Reply-to: information as file metadata and you have recursive structure.

(Sidebar: Actually, you can think of the process of improving the filesystem - large parts of that process, anyway - simply as the process of fixing email. Every email ought to be an ordinary file like any other document; instead emails live as entries in spool files around which mail agents perform ritual lockfile dances. A filesystem which handles smaller files more efficiently allows us to store each email as a file, but you have to keep those files in a Maildir and continue observing special safe-access rituals. Introduce transactions and you can just put your emails into ordinary folders, but everyone knows by now that just putting each of your emails into one folder or another is a completely inadequate way of organising them. Introduce pathname-listing and every email can usefully be in several directories at once; this means that we can indicate all the categories and "labels" we put on our emails by just putting them in directories instead of having to use special data formats understandable only to email clients (or worse, only to one email client). But there is still the (meta)data in the email headers themselves - we don't want to have to either duplicate or ignore it in our directory metadata. So we use mount() to expose persistent queries on the header data as directories.)

Quoted 8 lines

You had a separate directory storing relationship links. How about making that a subdirectory of the person? If I wanted to do genealogy-as-a-file-system, I'd have a "children" subdirectory under the person; it would contain hard links to all the person's children. If you want to find a person's mother or father, examine the list of their parent directories (a cyclic file system has more parents than just "..") to find the ones called "children". The person's parents are the holders of those "children" directories.

You can use the same one-to-many approach with link-directories:
instead of creating a link directory for each (biological) parent-child pair, create one for each parent which links it to all its children. (Having the individual link-directories is better in one
way: it's safe to go from the one-to-one to the one-to-many form without context knowledge, but not /vice versa/. In the case of the parent-child relationship, if a person is a parent to a bunch of children then that person is individually a parent to them all. But if a person hasLessMoneyThan a bunch of people, then (s)he may not have less money than any one of them.)

The (biological) parent-child relationship is kind to subfile metadata again here: the one-to-many link makes the (biological) parent an even more obvious candidate to go "on top". Problem five from part two is as strong as ever, on the other hand: there's no way for a program to tell without context knowledge that bob;children asserts a relationship between bob and several other files, rather than asserting some attributes of bob or describing some subparts of it.

Quoted 2 lines

I wouldn't worry about naming conflicts (such as "children" being a magic name) since most people only define a few dozen relationships, at least in BeOS. [snip]

If the names are only being created and used by one person, then yes, conflicts are likely to be rare and easily dealt with by hand. But if you have more than one person involved, and especially if you are trying to use different bundles of names created independently by different groups, then people will soon resort to the usual defensive practises used in package naming. Since any application could potentially define and use a bunch of its own subfile names just as it can create several (ordinary) directories, this situation will arise as soon as subfile names become popular.

[snip]

Quoted 7 lines

So to sum up, it seems that you're way more power hungry than I. I just want something to make finding photos easier, not a whole database equivalent system (I'd use a database for that). Early versions of BeOS did use a database as the file system, which turned out to be more trouble than it was worth. A file system can and perhaps should be something lighter. But not as lightweight as plain Unix file systems - I want better searching and linking.

I could say quite a lot about this, but I'll try not to.

First, as the Reply-To: example shows, fairly high-powered filesystem stuff is (at least) useful in many pretty ordinary and common situations. And the goal of namespace integration involves the high-powered stuff: eliminating things like RDBs or mbox files altogether, or at least assimilating their interfaces to the filesystem interface.

But I'm not just greedy for power here, I'm also greedy for elegance. The reason why I dislike things like subfile metadata is not simply because they're not powerful enough, but also because they're ad-hoc weld-ons. I want to see the power of the Unix filesystem multiplied without diluting its cleanness. The price to pay is that any filesystem implementation which fully supports all that additional power (with "good enough" performance all round) is going to be harder to create than a traditional Unix filesystem, or (probably) even a traditional Unix filesystem with a couple of extra widgets attached.

(Someone's going to have to sit down someday and come up with conventions to disambiguate the n different meanings of the word 'filesystem' in the Unix context...)

Quoted 2 lines

- Alex

Leo.

--
Leo Richard Comerford - http://www.st-and.ac.uk/~lrc1 - accept no namesakes :)