Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!pasteur!ucbvax!tut.cis.ohio-state.edu!osu-cis!att!cbnewsc!tjr From: tjr@cbnewsc.ATT.COM (thomas.j.roberts) Newsgroups: comp.sys.ibm.pc Subject: Re: MS-DOS puzzle #1 Message-ID: <552@cbnewsc.ATT.COM> Date: 24 Apr 89 15:45:19 GMT References: <238@cbnewsh.ATT.COM> Organization: AT&T Bell Laboratories Lines: 26 From article <238@cbnewsh.ATT.COM>, by mbb@cbnewsh.ATT.COM (martin.b.brilliant): > From article <6893@bsu-cs.bsu.edu>, by dhesi@bsu-cs.bsu.edu (Rahul Dhesi): >> Question: Why does COMMAND.COM allow redirection of standard >> input and standard output, but not standard error? >> >> 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. > > The real answer to the question is that the designers of MS-DOS thought > it would be good to allow redirection of standard input and standard > output, but that error messages should always go to the screen. So > they wrote MS-DOS to direct all error messages to the screen. It's even worse than that (!) - you CAN redirect file-descriptor 2 in a program that then EXECs another program. Unfortunately, some programs put error messages onto file-descriptor 2, and some put them directly onto the screen. The "designers" (:-^) of MS-DOS decided NOT to standardize how error messages are presented. [IMHO that was a very arrogant attitude on their part, and is merely one instance of why MS-DOS is so difficult to do serious applications in (e.g. look at the TSR mess)]. Tom Roberts att!ihnet!tjr