home *** CD-ROM | disk | FTP | other *** search
- The Source
- ----------
-
- This /dev/fd driver is loosely based on one written by Mike
- "Ford" Ditto for the AT&T UNIX pc. This version runs on SCO
- XENIX 386, version 2.3+. The install script included will
- configure the kernel, edit /usr/sys/conf/link_xenix, and build
- the new kernel and device files in /dev/fd.
-
- Building the driver
- -------------------
-
- To properly build everything, move the Makefile, dup.c and
- Install script into a new directory called /usr/sys/io/dup, and
- run make in that directory. Then run Install.
-
- What /dev/fd is
- ---------------
- 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.
-
- The most common use for the /dev/fd driver that I have found is
- for "process substitution" under the shell rc, and those
- versions of the Korn shell that support it. For example, to
- use jove's "parse-error-file" function, you could say
-
- ; jove -p <{egrep -n funcName *.c}
-