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

  1. Submitted-by: addw@phcomp.co.uk (Alain Williams)
  2.  
  3. > Anyway, since we're discussing what is and isn't in the POSIX name space,
  4. > I'd like to put in a plug for the /dev/fd directory.  Opening /dev/fd/7 is
  5. > equivalent to doing a dup(7); it is a generalization of the "treat '-' as
  6. What happens if you do an ``ls -l'' on /dev/fd, do you see the fds which are
  7. open to the ls program or all possible fds, even those which aren't opened ?
  8.  
  9. > (In fact, in V8 - V10, /dev/stdin, /dev/stdout, /dev/stderr, and /dev/tty are
  10. > links to /dev/fd/0, /dev/fd/1, /dev/fd/2, and /dev/fd/3, respectively.  The
  11. > last, in particular, is a nice generalization, and eliminates an ugly special
  12. > case in the kernel; init just does one more dup.)
  13. I always thought that /dev/tty was a means of getting hold of the tty when
  14. you couldn't be certain that 0,1,2 was connected to it. What you are really
  15. saying is that the UNIX convention of 0,1,2 having ``pre defined uses'' be
  16. extended to `3 always connected to the terminal and used for nothing else'.
  17. It isn't a /dev/fd issue, it is a UNIX convention issue.
  18. The other thing is the /dev/tty is a guaranteed way of getting the terminal
  19. & not something else (that is why the passwd program uses /dev/tty).
  20.  
  21. Alain Williams
  22.  
  23. +44 734 461232
  24.  
  25. phLOGIN our Turnkey Security Login utility is available NOW - ask me for info.
  26.  
  27. Volume-Number: Volume 22, Number 5
  28.  
  29.