Xref: utzoo unix-pc.general:3209 comp.sys.att:6876 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!cbmvax!kenobi!ford From: ford@kenobi.commodore.com (Mike Ditto) Newsgroups: unix-pc.general,comp.sys.att Subject: /dev/fd device driver to be posted Keywords: unixpc /dev/fd device driver Message-ID: Date: 2 Jul 89 20:04:20 GMT Organization: Omnicron Data Systems, West Chester, PA Lines: 34 I have written a "/dev/fd" device driver for the Unix PC (actually it should work on any SysV system aside from the install script). I am posting it to unix-pc.sources (and comp.sys.att). Here is an description of /dev/fd, which will also be in the source posting. The /dev/fd driver effectively allows you to specify an already-open file descriptor number where a path name is normally required. This allows a program that demands a path name to be used to process standard input or standard output by specifying /dev/fd/0 or /dev/fd/1, respectively. /dev/stdin and /dev/sdtout are links to the respective entries in /dev/fd/. This is primarily useful when running a poorly-written program that has no provision for using stdin/stdout. For example: find . -cpio /dev/stdout | compress > /dev/rfp021 (The "-cpio" option of the "find" command demands a file name and normally can not write to standard output. This example gives it the name "/dev/stdout" allowing it to be piped directly to compress rather than writing to a temporary file.) Note that some programs which demand a file name do so because they must lseek(2) on the file, and thus will not work if told to process stdin and stdin is a pipe. -=] Ford [=- "The number of Unix installations (In Real Life: Mike Ditto) has grown to 10, with more expected." ford@kenobi.commodore.com - The Unix Programmer's Manual, ...!ucsd!crash!kenobi!ford 2nd Edition, June, 1972. ditto@amix.commodore.com