X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: "Rod Pemberton" Newsgroups: comp.os.msdos.djgpp Subject: Re: redirect stderr to stdout/file in djgpp 2.x Date: Wed, 14 Apr 2010 14:22:59 -0400 Organization: Aioe.org NNTP Server Lines: 32 Message-ID: References: <97e7dd63-3c51-4796-a5ba-c8a1cddaabbc AT w17g2000yqj DOT googlegroups DOT com> <57a05b96-b688-4c09-93b5-f2bd3d2501a1 AT r18g2000yqd DOT googlegroups DOT com> NNTP-Posting-Host: pldq+kT97bAAp/ObDwnZyQ.user.speranza.aioe.org X-Complaints-To: abuse AT aioe DOT org X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1983 X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Microsoft Outlook Express 6.00.2800.1983 X-Priority: 3 X-MSMail-Priority: Normal Bytes: 2283 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Rugxulo" wrote in message news:57a05b96-b688-4c09-93b5-f2bd3d2501a1 AT r18g2000yqd DOT googlegroups DOT com... > On Apr 8, 9:08 am, Eli Zaretskii wrote: > > > > No. With DJGPP v1.x, it was possible because the extender was running > > the DJGPP program, so it was possible to use the DOS file handle > > inheritance to provide this feature. In v2.x, the "extender" is just > > a DPMI server, and the program runs independently of it. Therefore, > > file handles are not (and can not) be inherited. > > I think it was Rod P. a year or so ago that mentioned the following > tiny TSR in one of his posts. So thanks, Rod! ;-) > > http://johnsantic.com/comp/tsr.html > Yeah, looks like I did post that link, but over on comp.os.msdos.programmer. I've noticed that both John's TSR and DJGPP's redir.exe don't interleave stderr and stdout messages the way they are emitted to the screen. Both seem to write out stderr messages to the file first followed by stdout. I combined Santic's redirection with another TSR of mine that converts LF and CRLF to CRLF. That way both DOS an Unix line endings work correctly. Those two things, wrong line-endings and stderr different from stdout, are two of the annoying things I've come across with DJGPP. Rod Pemberton I'm also posting a NASM version of his code in another post.