home *** CD-ROM | disk | FTP | other *** search
- Submitted-by: brnstnd@KRAMDEN.ACF.NYU.EDU (Dan Bernstein)
-
- Sean Fagan writes:
- > 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.
-
- But pipes *still* aren't in the filesystem in any popular UNIX variant.
- The proponents of super-open() seem to want to be able to create new
- files, new TCP connections, and so on with a single system call. *How is
- open() going to create new pipes*? If you can't answer this question
- then you don't really support the ``everything should be in the
- filesystem'' philosophy. (I certainly can't answer it.) If POSIX invents
- an answer then what's the chance it'll find the best technical solution?
-
- > 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 .)
-
- So put it into your shell! There's nothing stopping you. tcsh sources
- are freely available.
-
- > 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?
-
- How about this: Pipes don't belong in the filesystem. Some UNIX variants
- swap pipes out to disk, but most don't. What if you don't have a
- directory available for the mknod()? Implementing pipe() on top of
- mknod() is dangerous! Anyway, I don't think named pipes are really
- relevant to the discussion; you don't create a *new* pipe through the
- filesystem when you open() a named pipe.
-
- > The question is: is this amount of generalization worth it? I'm not sure.
-
- The question is: Has this amount of generalization appeared in any
- popular UNIX system, let alone a sufficient number of systems that we
- can honestly call it an industry standard?
-
- > Tell me, Dan, how do you feel about the /dev/fd filesystem/pseeudo devices?
-
- I think they're well-done kludges to deal with non-UNIXy programs: i.e.,
- programs which think that everything's a file. /dev/fd brings those
- programs in line with the real philosophy: everything's a file
- *descriptor*.
-
- Imagine a shell syntax analogous to <$(program) which produces just a
- descriptor number---3 instead of /dev/fd/3. This is trivial to
- implement. Then imagine that the non-UNIXy programs are rewritten to
- take file descriptor arguments instead of filename arguments. This, too,
- is trivial to implement. Result: You get all the advantages of ksh's use
- of /dev/fd, *but you don't need a single kernel change to implement it*.
-
- Perhaps you're right. Perhaps super-open() would make life simpler for
- UNIX programmers. But I don't see anything it can do which file
- descriptors can't do in combination with well-written utilities. I am
- disgusted at the idea that POSIX members ``expect'' super-open() to be
- ``standardized.'' Where's the history of failures and successes in
- solving the problem (if there even is a problem!) of opening files?
-
- ---Dan
-
-
- Volume-Number: Volume 26, Number 69
-
-