/dev/fd device driver to be posted

Mike Ditto ford at kenobi.commodore.com
Mon Jul 3 06:04:20 AEST 1989


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 at kenobi.commodore.com
- The Unix Programmer's Manual,		...!ucsd!crash!kenobi!ford
  2nd Edition, June, 1972.		ditto at amix.commodore.com



More information about the Unix-pc.general mailing list