Re: Representation of structure in filesystems Was:Albods,reiserfs,trolls and an lot of other things

Horst von Brand (vonbrand@inf.utfsm.cl)
Tue, 06 Jul 1999 09:17:08 -0400


"Morten S. Nielsen" <msn@ipt.dtu.dk> said:

[...]

> There is this underlying in unix (and i suppose most other OS's) that a
> file may hold only one type of data. This makes it easy to handle the file
> because the data type is homogenous throughout the file. The ordering
> within the file is "start to end".

One of the _advances_ on Unix is that files are just streams of bytes,
nothing more, nothing less. I did work with OSes with "records" and
"types of files", and they were just a royal pain.

One of the problems here is to assume that if
(a) some obscure OS does something differently,
(b) everybody else does it the Unix way today
then it has to be a good idea. Many of the "good ideas" bandied around
have been tried before, and failed. Perhaps not miserably, but failed. The
Unix model has stood the test of time, and it has been almost universally
adopted, often junking other schemes. So there has to be _something_ in it
that is right...

> On the other hand, when programmer/user needs to compound different data
> types, he may use directories to imply the underlying structure of his
> data - like the kernel tree hierachy, often with a glue file (like the
> Makefiles or a html file) or make the stucture himself within one file,
> like it is seen in spreadsheets and documents. (I'm not saying that the
> kernel tree is supposed to be one object...)

But it is!

> I think that structure within the file is often very tedious to work
> with as a programmer (for different data types and non sequential data)

Very true. That's why you don't keep all your stuff in one big HOME file.

> and the structure within directories too shaky and short lived. This is
> (a little) like programming i F77 with no support for abstract data types.
> You are able to make your own intrepretation of the data in an array to
> suit your need for different interpretation of different data or your are
> able to make a lot of arrays with each their own way of being handleded.

That's why Pascal added record (struct in C). The problem is that they are
programmer-defined, i.e. hard to shoehorn into one schema. Unix goes for
the lowest common denominator: Streams of bytes, you (programmer) impose
whatever structure you want. Not maximally confortable, but it works. And
does not need specialized tools for "copy a file of foo records" or such.

-- 
Dr. Horst H. von Brand                       mailto:vonbrand@inf.utfsm.cl
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/