home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / v21 / 206 < prev    next >
Internet Message Format  |  1990-12-05  |  4KB

  1. From std-unix-request@uunet.uu.net  Thu Oct 18 00:26:12 1990
  2. Received: from cs.utexas.edu by uunet.uu.net (5.61/1.14) with SMTP 
  3.     id AA11561; Thu, 18 Oct 90 00:26:12 -0400
  4. Posted-Date: 17 Oct 90 01:55:19 GMT
  5. Received: by cs.utexas.edu (5.64/1.80) 
  6. From: think!barmar@cs.utexas.edu (Barry Margolin)
  7. Newsgroups: comp.std.unix
  8. Subject: Re: Names vs. fds -- it's a floor wax *and* a dessert topping
  9. Message-Id: <13690@cs.utexas.edu>
  10. References: <13392@cs.utexas.edu> <13441@cs.utexas.edu> <13642@cs.utexas.edu>
  11. Sender: fletcher@cs.utexas.edu
  12. Organization: Thinking Machines Corporation, Cambridge MA, USA
  13. X-Submissions: std-unix@uunet.uu.net
  14. Date: 17 Oct 90 01:55:19 GMT
  15. Reply-To: std-unix@uunet.uu.net
  16. To: std-unix@uunet.uu.net
  17.  
  18. Submitted-by: barmar@think.uucp (Barry Margolin)
  19.  
  20. In article <13642@cs.utexas.edu> chip@tct.uucp (Chip Salzenberg) writes:
  21. >According to brnstnd@kramden.acf.nyu.edu (Dan Bernstein):
  22. >>3. A unified namespace has not been tested on a large scale in the
  23. >>real world, and hence is an inappropriate object of standardization
  24. >>at this time.
  25. >"Advancement by invented standards" is an oxymoron, true.  Given that
  26. >POSIX seems to be intent on inventing *something*, though, I push for
  27. >a unified namespace.  Several people have described work with Unix (or
  28. >Unix-like) systems that keep everything in one namespace.  And surely
  29. >Plan 9 counts as "prior art."
  30.  
  31. Multics also has a unified namespace, although I suspect its interface
  32. would not be considered acceptable by most Unix folks (when users interface
  33. to it, the result looks a bit JCLish).
  34.  
  35. Rather than forcing everything into the file system hierarchy, Multics's
  36. generalized I/O system is based on dynamically linking to the procedure
  37. that knows how to open a particular type of I/O device.  The Multics
  38. equivalent to open() takes a character string, called an "attach
  39. description" that looks like a command line.  The first token in the string
  40. is transformed into the name of a subroutine, the dynamic linker is invoked
  41. to load the subroutine, and the remaining arguments are collected into an
  42. array of character strings that are passed as the argument list.  For
  43. instance, to open a file the call would look something like:
  44.  
  45.     fd = attach ("file /foo/bar/baz");
  46.  
  47. I've translated from Multics and PL/I style to Unix and C.  The Multics
  48. version also has an additional argument, to specify a label for the file
  49. descriptor, as there are commands to list and manipulate the attachments of
  50. the current process (note that on Multics the entire login session is a
  51. single process).
  52.  
  53. As another example, to attach to a TCP stream, the rsh command might do:
  54.  
  55.     fd = attach ("tcp think.com -port shell -privileged_local_port");
  56.  
  57. On Multics, there's a separate open() that is used after attach() (and,
  58. correspondingly, separate close() and detach()).  Attach() says what device
  59. (physical, as in a tape drive, or virtual, as in a file) you're attaching
  60. to, while open specifies how you're using it at any particular time (input
  61. vs output, file name on a labeled tape, etc.).  In the case of devices such
  62. as tape drives, this distinction allows keeping a tape drive reserved to
  63. the process while opening and closing individual files.
  64.  
  65. The user interface to this is the "io" command, with syntax like:
  66.  
  67.     io attach stdin file /foo/bar/baz
  68.     io open stdin -input
  69.  
  70. To fit this into Unix, you'd have to make a variant of > and < that is
  71. follwed by an attach description rather than a filename.  Actually, you
  72. could just use pipes, e.g.
  73.  
  74.     io attach stdout tape -drive 0 | dd ... | io attach stdin tcp ...
  75. --
  76. Barry Margolin, Thinking Machines Corp.
  77.  
  78. barmar@think.com
  79. {uunet,harvard}!think!barmar
  80.  
  81.  
  82. Volume-Number: Volume 21, Number 206
  83.  
  84.