Date: Thu, 08 May 2003 19:01:32 +0300 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: djgpp AT delorie DOT com Message-Id: <7458-Thu08May2003190131+0300-eliz@elta.co.il> X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 1.8.9 In-reply-to: <3EBA4A19.9090902@lml.ls.fi.upm.es> (message from Manuel Collado on Thu, 08 May 2003 14:14:17 +0200) Subject: Re: gawk 3.1.1: bug in stdout redirection on WinNT 4.0 References: <3EB7C0D6 DOT 7030206 AT lml DOT ls DOT fi DOT upm DOT es> <9003-Tue06May2003200634+0300-eliz AT elta DOT co DOT il> <3EB8F9A6 DOT 4050307 AT lml DOT ls DOT fi DOT upm DOT es> <2427-Wed07May2003165629+0300-eliz AT elta DOT co DOT il> <3EBA4A19 DOT 9090902 AT lml DOT ls DOT fi DOT upm DOT es> Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > Date: Thu, 08 May 2003 14:14:17 +0200 > From: Manuel Collado > Newsgroups: comp.os.msdos.djgpp > > F:\PRUEBAS\gawkbug>cat gawkbug.bat > @echo off > echo aaaaaaaaaaaaaaaaaaaaaaa > out.txt > gawk -f bbbb >> out.txt > echo ----------------------- > type out.txt > echo ----------------------- > gawk --version > > F:\PRUEBAS\gawkbug>gawkbug > ----------------------- > bbbb <======== overwritten > aaaaaaaaaaaaaaaaa > ----------------------- > GNU Awk 3.1.1 > Copyright (C) 1989, 1991-2002 Free Software Foundation.... > > > F:\PRUEBAS\gawkbug>gawkbug > ----------------------- > aaaaaaaaaaaaaaaaaaaaaaa > bbbb <======== appended > ----------------------- > GNU Awk 3.0.6 > Copyright (C) 1989, 1991-2000 Free Software Foundation.... Thanks. This seems to be a convincing argument in favor of some problem with redirected handles. > > Redirection from the command line has nothing to do with Gawk (or any > > DJGPP program). The redirection is done by the shell you are using, > > either Bash or CMD.EXE. It's possible that CMD.EXE from NT4 has > > problems with redirection when it runs DOS programs (I think I've > > heard in the past a couple of reports along these lines, but I'm not > > sure). > > Yes, this is what puzzles me. But the fact is that gawk 3.0.6 behaves > correctly. And also other DJGPP ported utilities that write to stdout. > > Thinking about possible causes, I'm considering the following possibilities: > > - The ported gawk 3.1.1 code makes some test on the stdout handler and > resets the file pointer in some circumstances. > > - The same action is performed at the library level. Then how come the same Gawk works with Bash as the shell? Perhaps the redirected handle is set up by CMD.EXE so that the overwriting results? I'm just stabbing in the dark here... > Before looking at the sources or further investigation, I would like to > know if there is a way to know which library version has been used to > build each particular version of gawk. It's not easy. Try "strings gawk.exe" and look at the string "DJGPP libc". But some people have their libraries patched without updating the library version string... > I could also try to rebuild gawk from the sources. But in that case I > would like to use exactly the same library version. You could use stock v2.03 and the alpha version of v2.04, and compare the results.