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, 5 May 2010 17:03:35 -0400 Organization: Aioe.org NNTP Server Lines: 36 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> <83633tye60 DOT fsf AT gnu DOT org> 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: 2455 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Eli Zaretskii" wrote in message news:83633tye60 DOT fsf AT gnu DOT org... > > "Rod Pemberton" > > > > 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. > > Actually, redir.exe does nothing of the kind. In particular, it > doesn't write anything, and thus cannot control the order in which > stdout and stderr output are interleaved. What redir.exe does is just > redirect stderr to the same file or device as stdout. The actual > writes are done by the program that is invoked under redir.exe. > > It could be that you get the _impression_ that this is what redir.exe > does, because stderr is usually unbuffered, and so tends to be flushed > by the library and the OS sooner than stdout. But this is something > redir.exe has no control of, and cannot change, the way it was > designed and implemented. > OpenWatcom 16-bit/32-bit app's also interleave stderr and stdout message correctly when emitted to the screen but fail to do so when redirected to a file via redir.exe or John's TSR. When redirected to a file, all stderr messages are first and all stdout messages are last. So, it seems this is something to do with DOS' redirection mechanism. Or, perhaps it's an issue with DOS' buffering as you've stated. Rod Pemberton