Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!netnews.upenn.edu!lfk From: lfk@mbio.med.upenn.edu (Lee Kolakowski) Newsgroups: comp.sys.ibm.pc Subject: Re: MS-DOS puzzle #1 Message-ID: Date: 22 Apr 89 15:48:26 GMT References: <6893@bsu-cs.bsu.edu> <238@cbnewsh.ATT.COM> Sender: news@netnews.upenn.edu Organization: University of Pennsylvania, Dept. of Chemistry Lines: 51 In-reply-to: mbb@cbnewsh.ATT.COM's message of 22 Apr 89 12:38:49 GMT mbb@cbnewsh.ATT.COM (martin.b.brilliant) writes: > 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 PUZZLE. Does the above make any sense? If it does, why? If it > > does not, what is the real answer to the question? > No, it does not make any sense. In the first place, there is no such > thing as "UNIX". UNIX(R) is a trademark of AT&T. > > 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. First off, what filehandles are redirectable is just a matter of what mechanisms the shell provides. It has nothing to do with MS-DOS the underlying operating system, but instead with the most common shell "command.com". I know of at least two replacement shells which allow you to redirect any file handle. MKS does it well with their shell, and Command-Plus also allows this to happen. Command.com's authors did not create redirectable filenos other than 0 and 1. All you have to do is, given a command to redirect a file number somewhere, dup that fileno to somewhere else. Seems resonable to me. If you need that capablity, don't argue that it can't be done, use the product that does it. -- Frank Kolakowski ===================================================================== |lfk@mbio.med.upenn.edu || Lee F. Kolakowski | |kolakowski@mscf.med.upenn. || Univ. of Penna. | |c/o jes@eniac.seas.upenn.edu || Dept of Chemistry | |kolakowski@c.chem.upenn.edu || 231 South 34th St. | |bcooperman.kolakowski@bionet-20.arpa || Phila, PA 19104 | |AT&T: 1-215-898-2927 ||--------------------------| |#include || One-Liner Here! | =====================================================================