Filesystem idea
Posted: Mon Jan 14, 2008 9:23 am
I was digging around in the text file graveyard that is my home directory and found this - I thought I'd post it here to get people's thoughts. I particularly like the first idea - I think the second idea could be of merit too though.
---------------------------------------------
Idea for filesystem design.
POSIX-style, but add a '?' operator to files and directories, as a
'union' operator.
Union Directories
=================
'?' applied to directories (without anything as a suffix) would list
all directories that make up this one (union directories, as in
plan9):
$ ls -l /usr/include/?
lrw-r--r-- 1 -> /usr/include/
lrw-r--r-- 2 -> /usr/local/include/
So that directory actually consists of it's contents *plus* the
contents from /usr/local/include.
/usr/local/include/ can also be accessed by:
$ cd /usr/include/?2
Files and metadata
==================
'?' applied to files would retrieve files works in a similar way. On
most files ls /file? will return nothing (empty set). One can,
however, define regions within a file that appear as nested files. For
example, the html file:
<html>
<head>
<title>This is a title</title>
</head>
</html>
Could have a region 'title' which consists of 'This is a title'
(offset of 20, length of 15).
Likewise:
$ ls file.html?
title body head
So a process could obtain just the 'body' content by opening:
fopen("file.html?body", "r");
Obviously these regions have to be read-only, but this makes adding
meta-data much much easier.
---------------------------------------------
Idea for filesystem design.
POSIX-style, but add a '?' operator to files and directories, as a
'union' operator.
Union Directories
=================
'?' applied to directories (without anything as a suffix) would list
all directories that make up this one (union directories, as in
plan9):
$ ls -l /usr/include/?
lrw-r--r-- 1 -> /usr/include/
lrw-r--r-- 2 -> /usr/local/include/
So that directory actually consists of it's contents *plus* the
contents from /usr/local/include.
/usr/local/include/ can also be accessed by:
$ cd /usr/include/?2
Files and metadata
==================
'?' applied to files would retrieve files works in a similar way. On
most files ls /file? will return nothing (empty set). One can,
however, define regions within a file that appear as nested files. For
example, the html file:
<html>
<head>
<title>This is a title</title>
</head>
</html>
Could have a region 'title' which consists of 'This is a title'
(offset of 20, length of 15).
Likewise:
$ ls file.html?
title body head
So a process could obtain just the 'body' content by opening:
fopen("file.html?body", "r");
Obviously these regions have to be read-only, but this makes adding
meta-data much much easier.