Mail Archives: djgpp-workers/2003/03/08/06:49:52
Hello.
Eli Zaretskii wrote:
[snip]
> Wait a minute, there's something I missed when I looked at that code:
> why do we need to disallow pwrite on redirected standard handles?
> Redirected standard handles are just normal files on DOS/Windows, so
> why should pwrite fail on them?
It seems to work OK.
> > With stdin, stdout, stderr we can assume they are pipes
>
> You can't, really. A redirected standard output could be a disk file,
> as in "foo > bar". What you are thinking about is "foo | bar", but
> that doesn't have to be so, and we have no way of distinguishing
> between these two possible uses of redirection.
[snip]
So we have a choice:
(1) Always fail the write for redirected stdout, stderr, just in case it's a
pipe.
(2) Always allow the write for redirected stdout, stderr.
Even in the case "foo | bar", the handle still refers to a file, even if it is
only a temporary one. So (2) seems good and works. But will (2) result in
behaviour that is Unixy programs don't expect?
The original patch does (1). If (2) sounds good, then I'll send in another
patch.
Bye, Rich =]
--
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]
- Raw text -