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

  1. Submitted-by: addw@phcomp.co.uk (Alain Williams)
  2.  
  3. > I agree; it makes things like 
  4. >     join <(prog1) <(prog2) > joined-output-of-progs-1-and-2
  5. > possible.
  6. Such things are possible *now*, you don't need /dev/fd to do it, just an
  7. intelligent shell that doesn't mind making & destroying fifos.
  8.  
  9. Anyway, the above wouldn't work with a straight /dev/fd as has been talked about
  10. here recently. Why ? The trouble is that if /dev/fd contains files with
  11. names "0", "1", ... "19", the programs prog1 & prog2 would both have a file
  12. /dev/fd/1 as their stdout, join would see another /dev/fd/1.
  13.  
  14. What is really needed to do what is suggested above is for /proc to contain
  15. an fd directory, thus the command line above would be ``re written'' by the
  16. shell to something like:
  17.  
  18.     join /proc/1234/fd/1 /proc/1235/fd/1 > joined-output-of-progs-1-and-2
  19. (where 1234 & 1235 are the process ids of prog1 and prog2).
  20.  
  21. If we adopt the /proc/nnn/fd idea, more questions are raised, for instance what
  22. are the file permissions on /proc/nnn/fd ?
  23.  
  24. Let me remind the original purpose for which /dev/fd was proposed:
  25. provide a mechanism whereby programs could handle `-' to mean stdin/out
  26. as does cat, but without trying.
  27.  
  28. Alain Williams
  29.  
  30. +44 734 461232
  31.  
  32. phLOGIN our Turnkey Security Login utility is available NOW - ask me for info.
  33.  
  34. Volume-Number: Volume 22, Number 7
  35.  
  36.