home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / volume.22 / text0002.txt < prev    next >
Encoding:
Text File  |  1991-03-06  |  2.5 KB  |  57 lines

  1. Submitted-by: craig@b11.ingr.com (Craig Presson)
  2.  
  3. In article <13878@cs.utexas.edu>, arnold%audiofax.com@mathcs.emory.edu
  4. (Arnold Robbins) writes:
  5. |> Submitted-by: arnold%audiofax.com@mathcs.emory.edu (Arnold Robbins)
  6. |> 
  7. |> Anyway, since we're discussing what is and isn't in the POSIX name space,
  8. |> I'd like to put in a plug for the /dev/fd directory.  Opening /dev/fd/7 is
  9. |> equivalent to doing a dup(7); it is a generalization of the "treat '-' as
  10. |> stdin" hack used by cat and awk (and others) and allows at least two shells
  11. |> (ksh and rc [see your nearest V10 manual]) to do interesting things like set
  12. |> up non-linear pipelines.  (At least I think rc does it.  I know ksh does.)
  13. |> 
  14. |> There's lot of existing practice on this one; it originated in V8, circa
  15. |> 1984 or earlier, and PD versions for various, more popular, Unix
  16. incarnations
  17. |> have been around for some time as well.
  18. |> 
  19. |> (In fact, in V8 - V10, /dev/stdin, /dev/stdout, /dev/stderr, and
  20. /dev/tty are
  21. |> links to /dev/fd/0, /dev/fd/1, /dev/fd/2, and /dev/fd/3, respectively.  The
  22. |> last, in particular, is a nice generalization, and eliminates an ugly
  23. special
  24. |> case in the kernel; init just does one more dup.)
  25. |> 
  26. |> It's going to be fun watching how /dev/fd will be presented as both for and
  27. |> against the case for "fd-centric" Unix... :-)  Personally, I'm in the
  28. put-it-
  29. |> in-the-filesystem camp.
  30. |> -- 
  31. |> Arnold Robbins                AudioFAX, Inc. | Laundry increases
  32.  
  33. Ah, roger, that's a big "ditto" on the virtues of One Big Namespace for
  34. all Permanent Objects. Use subspaces to separate classes (he said 
  35. tautologically) *.
  36.  
  37. But for those of us without access to every Unix manual ever published
  38. (I do have a Version 7 Volume 1), could you fill in a bit more on the
  39. semantics of this hybrid /dev entry? Like what do you get when you open
  40. "/dev/fd/7" and there is no open file using that slot? Does the system
  41. make these entries "invisible" to processes not using them? Do you just
  42. get a classic "It's an error from Unix, you're not supposed to understand"
  43. type return? Or am I Missing Something?
  44.  
  45.  
  46. --  ******************************************************
  47.     ** Craig Presson              pressonc@ingr.com     **
  48.     ** Intergraph Corporation             MS CR1104     **
  49.     ** Huntsville, AL 35894-0001     (205) 730-6176     **
  50.     **                       FAX:    (205) 730-6011     **
  51.     ******************************************************
  52. * Those not old enough to remember "Tom Swifties" are encouraged
  53. to forgive my lapse of taste ...
  54.  
  55. Volume-Number: Volume 22, Number 3
  56.  
  57.