Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!husc6!bloom-beacon!tut.cis.ohio-state.edu!osu-cis!att!ihuxy!vg55611 From: vg55611@ihuxy.ATT.COM (Gopal) Newsgroups: comp.sys.ibm.pc Subject: Re: MS-DOS puzzle #1 Message-ID: <2936@ihuxy.ATT.COM> Date: 22 Apr 89 19:09:36 GMT References: <6893@bsu-cs.bsu.edu> Reply-To: vg55611@ihuxy.UUCP (55421-Gopal,V.P.) Organization: AT&T Bell Laboratories - Naperville, Illinois Lines: 31 In article <6893@bsu-cs.bsu.edu> dhesi@bsu-cs.bsu.edu (Rahul Dhesi) writes: > Question: Why does COMMAND.COM allow redirection of standard > input and standard output, but not standard error? I think the question really should be - why does MS-DOS allow stdin/stdout redirection but not stderr ? Command.com simply goes through DOS to do the redirection (by playing with the filehandles etc.) > Answer: MS-DOS, unlike UNIX, doesn't have a fork() system call; > therefore the MS-DOS command interpreter, unlike the > UNIX shell, can't redirect standard error. 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. >THE PUZZLE. Does the above make any sense? If it does, why? If it >does not, what is the real answer to the question? Venu P. Gopal UUCP: att!ihuxy!vg55611 Internet: vg55611@ihuxy.att.com BITNET: com%"vg55611@ihuxy.att.com" or com%"vg55611%ihuxy@research.att.com" Silence those silent letters and save the world 500 million keystrokes a day.