Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!lll-winken!uunet!attcan!lsuc!maccs!cs3b3aj From: cs3b3aj@maccs.McMaster.CA (Three More Exams) Newsgroups: comp.sys.ibm.pc Subject: Re: MS-DOS puzzle #1 Summary: std??? Keywords: stderr stdin stdout command.com Message-ID: <2535@maccs.McMaster.CA> Date: 24 Apr 89 00:46:51 GMT References: <6893@bsu-cs.bsu.edu> <2936@ihuxy.ATT.COM> Reply-To: cs3b3aj@maccs.UUCP (Three More Exams) Organization: McMaster U., Hamilton, Ont., Can. Lines: 31 In article <2936@ihuxy.ATT.COM> vg55611@ihuxy.UUCP (55421-Gopal,V.P.) writes: >I don't think MS-DOS has stderr defined. I think at one point, a very early >point (DOS 1.00 ?), it didn't even have stdin and stdout defined, you only >had keyboard / display services. Later, stdin and stdout were defined, and >the keyboard/display services were mapped to these. At that time, they >could have added stderr services, but they didn't. >If application programs and compilers seem to have stderr, I am quite sure >that it is because they bypass DOS and use BIOS to write to the display >directly. Some correct points, some incorrect ones. Dos 1.* did not support any form of redirection (it didn't have the "handle" concept at that point ... all file I/O was done with file control blocks, and I/O to the console, AUX, etc. was done with specific DOS calls cloned from CP/M). DOS 2.* and up added file handle support, and define five handles which your program automatically receives: 0: Standard input, CON by default 1: Standard output, CON by default 2: Standard error, always connected to CON 3: Auxiliary, usually connected to COM1 4: List device (PRN), usually connected to LPT1 So DOS _does_ have stderr, and if you write a C program which outputs to stderr it will work without the compiler having to translate your output statements into BIOS calls. -- ====================================================================== ! Stephen M. Dunn, cs3b3aj@maccs.McMaster.CA ! DISCLAIMER: ! ! I always wanted to be a lumberjack! - M.P. ! I'm only an undergrad ! ======================================================================