Mail Archives: djgpp/2001/01/01/13:52:09
> From: jmichel AT schur DOT institut DOT math DOT jussieu DOT fr (Jean Michel)
> Newsgroups: comp.os.msdos.djgpp
> Date: 1 Jan 2001 17:24:47 +0100
> ...
> >The program can know that it writes to a console device: it just needs to
> >call isatty() on the handle. It can also filter out ^Z characters if
> >stdout is connected to the console. Finally, it can remove trailing ^Z
> >from input after it reads it. (Such removal will happen automatically if
> >the input is read in text mode.)
> >
> >Would that solve the problem?
>
> Well, does not djgpp claim to be an environment which makes it easy to
> port Unix programs to DOS (even at the expense of doing a lot of
> contortions to implement stat accurately, for instance)?
We try, yes.
> I claim that in
> the same way it should be the job of the libc low-level routines to
> detect that the output is to a console device, and do the appropriate
> thing (filter ^Z, whatever) so that no spurious error is returned
This was discussed on the developers' list several times in the past.
Unfortunately, the conclusion was that there's no way of fixing this
without either breaking something else or fatally hurting performance
of programs which don't send ^Z to the console (those are the
majority, btw). For example, if low-level libc primitives would need
to scan each buffer they get for ^Z characters, instead of simply
handing it to DOS, they will become much slower.
I'd still like to know if the suggestions I made help you solve the
problem, and if not, why.
One other possibility is to use the DJGPP termios emulation, which
modifies the console I/O so that ^Z is no longer a problem. If ruby
is an interactive program coming from Unix, it probably tries to use
termios anyway; perhaps the DJGPP port disables that for some
(histerical?) reasons, in which case all you need to do is remove the
disabling code.
- Raw text -