Mail Archives: opendos/1997/02/04/03:42:26
Roger Ivie writes:
> If you overhaul COMMAND.COM to do direct screen writes, you still need to
> keep all the old I/O code around so that you can
>
> C:\> dir >booger.out
>
> I've picked dir because it's an internal command; a direct screen-writing
> COMMAND.COM can still provide I/O redirection for external commands in the
> normal manner. But for the internal commands, it will need to have _two_
> versions of the commands lying around so that there's one which can be
> redirected.
There won't be any need for two versions. In a worst case, you'd have
code like:
if ( isatty( hOutput ) )
{
OutputNormal( ... );
}
else
{
OutputFast( ... );
}
No big deal, and something many people have done many times before.
That's the great thing about DOS, it's so old, most if not all
problems like this were solved years ago and have moved into folklore.
:-)
--
Take a look in Hagbard's World: | w3ng - The WWW Norton Guide reader.
http://www.acemake.com/hagbard | ng2html - The NG to HTML converter.
Also available in the UK: | eg - Norton Guide reader for OS/2.
http://www.hagbard.demon.co.uk | dgscan - DGROUP scanner for Clipper.
- Raw text -