Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!uwvax!shorty!rose From: rose@shorty.CS.WISC.EDU (Scott Rose) Newsgroups: comp.sys.ibm.pc Subject: Re: MS-DOS puzzle #1 Message-ID: <7439@spool.cs.wisc.edu> Date: 23 Apr 89 01:14:44 GMT References: <6893@bsu-cs.bsu.edu> <238@cbnewsh.ATT.COM> Sender: news@spool.cs.wisc.edu Reply-To: rose@shorty.cs.wisc.edu (Scott Rose) Organization: U of Wisconsin CS Dept Lines: 13 The lack of redirectability of standard error is indeed an unfortunate feature of command.com. For those times when it is desirable to perform this redirection, Microsoft provides the "errout" command. It comes with MSC 5.x. It is fairly trival to write your own version of this command, by the by, by making use of the spawn() and dup2() library functions or the underlying MSDOS services. Simply use dup2() to connect standard error to standard output before spawning argv[1], with argv[2]...argv[argc-1] as the argument vector. This gives your executed program a little bit less memory than it would have if you ran it right from the primary command processor, but that's the only significant downside. Keep the name of the new command short and you won't sacrifice much command line length.