home *** CD-ROM | disk | FTP | other *** search
- Submitted-by: sef@kithrup.COM (Sean Eric Fagan)
-
- In article <1991Dec20.065940.11851@uunet.uu.net> brnstnd@KRAMDEN.ACF.NYU.EDU (Dan Bernstein) writes:
- >Many people share this ``expectation.'' I don't understand why. Is it
- >because of ``the UNIX philosophy''? Or because a super-open() is
- >supposed to be easier for programmers? Or for users?
-
- Possibly both. Having everything as a simple byte sequence certainly makes
- some things easier (although, to be honest, it makes other things more
- difficult).
-
- You bring up the concept of pipes, which didn't exist as files in the
- original systems. Well, a lot of things weren't in the original systems
- originally, either, and lots of people seem to think that some of the
- additions since V7 were a good idea. (The problem is that most of these
- people don't agree that *all* of the additions were a good idea, and they
- all have different ideas about what *was* a good idea to add 8-).)
-
- I am currently discouraged that I can't create a socket in my filesystem;
- there are things where it would be nice to do so. Oh, I can kludge around
- it, by making a named pipe, and using rsh/rcmd. But a named TCP/IP socket,
- to a specified host, would be nice. (E.g., cp
- /tcp/ip/ftp/uunet.uu.net/ftp/ls-lR.Z .)
-
- Unix also has the idea of unnamed files; normally, these are things like
- sockets or pipes, but they can also be files that were created, and then
- unlinked. Can you come up with a good reason (excluding efficiency, which
- I'll mention in a bit) *not* to support the creation a named pipe in the
- filesystem, forking, and then unlinking it, but keeping it open? Yes, this
- would be somewhat less efficient: doing a mknod(), which also involves
- going through the filesystem, then doing an unlink(), which is twice as many
- system calls as pipe().
-
- The question is: is this amount of generalization worth it? I'm not sure.
- I think that it would probably be good for a research system (and, then,
- maybe moving it into commercial systems, if the advantages are enough), but
- I can't heartily agree with it. Or disagree with it.
-
- I'm not saying I disagree with Dan. I'm just not saying I agree with him.
- (I feel like Charlie Brown: "I'll be wishy one day, and washy the next!")
-
- Tell me, Dan, how do you feel about the /dev/fd filesystem/pseeudo devices?
- As you point out, having every process know that it should use
- filedescriptor 0 for input, 1 for output, and 2 for error reporting has made
- a lot of things very easy for Unix and Unix programmers. (And 3 as the "tty
- device" is something that I don't necessarily agree with, but Plan 9 papers
- seem to report that it has worked out pretty well.) By having the file
- descriptors available in the filesystem name space, it makes some things a
- lot easier. E.g., "vi /dev/fd/0" (Ok, that's stretching it. How about
- ksh's use of it: "sed <$(foo1) <$(foo2) <$(foo3)" Using named pipes, of
- course, would do the same thing, except you'd have to clean them up
- afterwards.)
-
- --
- Sean Eric Fagan
- sef@kithrup.COM
-
- [ I'm going to ask people to use their judgement on this thread. It might
- belong in one of the comp.unix groups instead of here. -- mod ]
-
- Volume-Number: Volume 26, Number 51
-
-