I thought the following extract from Dave Williams' excellent
(but a somewhat dated) shareware "book", DOSREF, would
be of interest, regarding STDOUT... I don't think Ralf Brown's
interrupt list has this information, BTW ...

You can get a demo version (first few chapters) of DOSREF
at : http://www.darklogic.org/fdos/ftp/dosref/

Extract follows (not sure if this will come out right, if not, just
download that demo, see Chapter.007 ... OK? :-)    :


Special File Handles ............................................ 7**4

  DOS reserves five special file handles for use by itself and 
applications programs. They are: 

|-----------------------------------------------------------------------|
| 0000h | STDIN  | standard input device   (input can be redirected)    |
| 0001h | STDOUT | standard output device  (output can be redirected)   |
| 0002h | STDERR | standard error output device (output cannot be       |
|       |        |                               redirected)            |
|       |        | NOTE: DOS opens STDERR for both writing and reading. |
|       |        |  Since STDIN can be redirected, using STDERR to read |
|       |        |  the keyboard is a reliable way to ensure that your  |
|       |        |  program is actually                                 |
|       |        | reading the keyboard, if that's what you want to do. |
| 0004h | STDAUX | standard auxiliary device                            |
| 0005h | STDPRN | standard printer device (PRN, normally LPT1)         |
|-----------------------------------------------------------------------|

  These handles are predefined by DOS and can be used by an 
application program.  They do not need to be opened by a program, 
although a program can close these handles.  STDIN should be treated 
as a read-only file, and STDOUT and STDERR should be treated as write-
only files.  STDIN and STDOUT can be redirected.  All handles 
inherited by a process can be redirected, but not at the command line. 


[BTW, I was puzzled by that last line at first, but all
 I think it is saying, is just that only STDIN and STDOUT
 can be redirected via the command line ... Joe]

Regards to all,
Joe.

Reply via email to