Date: Wed, 22 Aug 2001 10:30:24 -0400 Message-Id: <200108221430.KAA02730@delorie.com> X-Authentication-Warning: delorie.com: eliz set sender to eliz AT delorie DOT com using -f From: Eli Zaretskii To: acottrel AT ihug DOT com DOT au CC: sandmann AT clio DOT rice DOT edu, djgpp-workers AT delorie DOT com In-reply-to: <00ae01c12b02$75f9d200$0a02a8c0@acceleron> (acottrel@ihug.com.au) Subject: Re: Fseek on STDIN problem on Win 2K References: <10108200508 DOT AA15103 AT clio DOT rice DOT edu> <2950-Mon20Aug2001093159+0300-eliz AT is DOT elta DOT co DOT il> <002501c12980$4c67fa80$0a02a8c0 AT acceleron> <2110-Mon20Aug2001172450+0300-eliz AT is DOT elta DOT co DOT il> <001101c12a42$7776d850$0a02a8c0 AT acceleron> <8011-Tue21Aug2001200758+0300-eliz AT is DOT elta DOT co DOT il> <00ae01c12b02$75f9d200$0a02a8c0 AT acceleron> Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > From: "Andrew Cottrell" > Date: Wed, 22 Aug 2001 22:03:29 +1000 > > seek.c 172 4200, flags = 0x02 pos = 0x0000:0000 Char at offset [0] = (3) > seek.c 172 4200, flags = 0x02 pos = 0x0000:0000 Char at offset [0] = (4) It looks like 4200 reports that it did move the file pointer, but the subsequent 3F00 still continues from the position before the lseek. > After I wrote the sentence above I thought that the possibel solution is to > add a seek to position 1 after the 3700 call and then to seek to zero. I > just tested this an it works. To include the change I found works change the > AC_PATCH_TEST_1 define to 1, to go back to the old code change the define > to 0. > > There are other changs in the code that I am working on, for example move > the processing of the retval to just after the 3700 call so that the > additional code will not overwrite the buffer. > > What do you think about this sort of solution for is_executable()? Right now, I'm more worried by lseek not working than by _is_executable. I think we need first to find a good general-purpose solution for lseek, so that we could be sure the file pointer moves to the right place. If that doesn't fix _is_executable, we can find some local trick later. > Thanks for this as it explains how come I could not see this anywhere as it > is up to the shell used. I wonder if bash or 4DOS shell has work? I will > also try this if I have time tomorrow night. Thanks, trying this with different shells might indeed shed some light on this problem.