Mail Archives: djgpp-workers/2001/08/23/02:13:23
> From: sandmann AT clio DOT rice DOT edu (Charles Sandmann)
> Date: Wed, 22 Aug 2001 14:41:04 -0500 (CDT)
>
> does the 2.03 library not call the is_executable?
Yes, it does.
> fstat() doesn't cause this problem in 2.03 which might explain why
> it's more rare).
So perhaps we should find out which change since v2.03 triggers this.
> I tried test >> testout
> I tried test >> nul
>
> fstat() is OK with handle 1, in both cases thinks it's a file, lseek
> says it's at the beginning (0) wrong for file append.
lseek returning 0 on append is correct for NUL, since NUL is always
empty. Does lseek say it's at the beginning for a non-empty file
testout as well? If so, this doesn't happen on Windows 98.
> First example gets the right size in fstat, second example says it
> is zero length.
Same thing happens here on Windows 98, and zero length is okay with
NUL. (I'm assuming that by ``second example'' you mean "test >>nul".)
> Both examples return times (first example is file time, second example
> is weird date in future).
The time for NUL should be the current time, but that code only works
if fstat detects that it's a device, which I presume isn't happening
on NT?
> In both cases _read fails on the handle.
Fails how? Do you mean to say that NT disallows reads on stdout? It
does work on Windows 98: I redirected stdout into a raw COFF file, and
fstat readily reported it's an executable.
> Proposal: fstat() (or dev info?) does the following:
> if dev_info == 0 and NT and handlenumb <5 dev_info = 0x8000
How is this better than leave the current problems with fstat intact?
(Admittedly, I don't remember anymore why this was a grave problem ;-)
Also, I think Bash uses handle 5 quite a lot in configure scripts, and
the programs it invokes inherit the redirection. (Mark, am I right?)
Does redirection from Bash have this problem? (I think you said no,
but I'm not sure.)
- Raw text -