Mail Archives: djgpp-workers/2003/03/07/20:11:45
Hello.
DJ Delorie wrote:
>
> > But is there any easy way we can distinguish between pipes and (regular
> > files, character devices)? With stdin, stdout, stderr we can assume they
> > are pipes, if they are not TTYs. But we can't assume that for other file
> > descriptors - we can use fd_props, if available, to find out. Hence the
> > code only checks stdout & stderr using isatty().
>
> DOS only has two types of file things: devices and disk files. We
> don't need the seek fix on devices.
OK, that's how it currently works.
I thought we were talking about how to detect TTYs that have been redirected
(aka piped), so that we can fail pwrite and set errno == ESPIPE.
> > BTW stdaux and stdprn are not TTYs according to isatty(). Is this a bug?
>
> Hmmm... probably. The code in isatty.c looks suspect; it only returns
> true if a device is both stdin *and* stdout. It should probably also
> just check for device vs file.
I see what you mean. Are all character devices TTYs? Or is that an oxymoronic
question?
Bye, Rich =]
--
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]
- Raw text -