Gack... memories of trying to parse jpeg headers...
I've heard other people whining about Linux's decision to view everything as a file. Your fdisk experience seems to provide evidence that this can be a useful point of view.
Well, there are lots of things in Unix which are not files, and have to be accessed via special API's. In Plan9, everything is treated as a file and accessed via the filesystem (http://www.cs.bell-labs.com/sys/doc/names.html). (The /proc filesystem in Linux, btw, is directly inspired1 by Plan9.) A good example is the framebuffer. In Plan 9, the windowing system (http://www.cs.bell-labs.com/sys/doc/8%bd/8%bd.html) talks to the console via the standard filesystem interface, but the cool part is that it provides exactly the same interface that it uses, meaning that it's trivial to run a copy of the windowing system inside of a copy of the windowing system, run any non-windowing application within the windowing system, or export the whole windowing system over the network. Anyways, it's very nifty.
(1 ``UNIX is obviously the mother of Linux in that sense, in that we stole all the basics. But a lot of ideas come from a small operating system called Plan 9 that was done by a lot of the same guys who did UNIX in the first place. Plan 9 is not something that a normal person would like to use, but it had a lot of nice ideas. So we stole some of them.'' -- Linus Torvalds, 1999)
no subject
Date: 2004-04-06 06:02 pm (UTC)I've heard other people whining about Linux's decision to view everything as a file. Your fdisk experience seems to provide evidence that this can be a useful point of view.
no subject
Date: 2004-04-06 06:14 pm (UTC)no subject
Date: 2004-04-06 06:27 pm (UTC)no subject
Date: 2004-04-06 07:33 pm (UTC)/proc
filesystem in Linux, btw, is directly inspired1 by Plan9.) A good example is the framebuffer. In Plan 9, the windowing system (http://www.cs.bell-labs.com/sys/doc/8%bd/8%bd.html) talks to the console via the standard filesystem interface, but the cool part is that it provides exactly the same interface that it uses, meaning that it's trivial to run a copy of the windowing system inside of a copy of the windowing system, run any non-windowing application within the windowing system, or export the whole windowing system over the network. Anyways, it's very nifty.(1 ``UNIX is obviously the mother of Linux in that sense, in that we stole all the basics. But a lot of ideas come from a small operating system called Plan 9 that was done by a lot of the same guys who did UNIX in the first place. Plan 9 is not something that a normal person would like to use, but it had a lot of nice ideas. So we stole some of them.'' -- Linus Torvalds, 1999)
no subject
Date: 2004-04-06 11:34 pm (UTC)