🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.ibm.pc
Article #39831

Re: Redirection and piping

#39831
From: Stephen M. Dunn
Date: Fri, 15 Dec 1989 18:34
38 lines
2531 bytes
   Redirection and piping work the same, essentially, in DOS as they
do in UNIX, except they have some limitations.  DOS only allows you to
play with stdin and stdout, whereas UNIX lets you redirect any handle
you wish.  And, of course, when piping something, UNIX lets you run
both tasks simultaneously, while DOS dumps the output of the first
program into a disk file and then runs the second program with its
stdin coming from that file.  Other than that, they're pretty much
the same.

   The problem you're having probably stems from the fact that in
DOS, there are ways of reading input and writing output that have
nothing to do with stdin and stdout.  For example, it is faster to
either use BIOS calls or direct screen memory writes than go through
DOS when you want to print something on the screen, so many programs
do this.  As far as DOS is concerned, such programs do not produce
any output, since they don't do it through stdout, and therefore
they cannot have their output redirected.

   In an analogous fashion, keyboard input can be done with BIOS
calls rather than through DOS (although the speed of keyboard input
is not a factor here, since even the fastest typists among us don't
come anywhere close to the computer's I/O speed limit).  The reason
for doing this is that using the BIOS allows you to check for the
next character without having it removed from the queue, and check
to see if the queue's empty, and other such tricks that DOS's
stdin won't allow you to do.  Such programs do not read from stdin,
and therefore stdin redirection will have no effect upon them.

   The program that you can't get to read redirected input probably
does its keyboard input directly through the BIOS.  I'm afraid that
if this is the case, you're out of luck.

-- 
Stephen M. Dunn                               cs4g6ag@maccs.dcss.mcmaster.ca
          <std_disclaimer.h> = "\nI'm only an undergraduate!!!\n";
****************************************************************************
    If it's true that love is only a game//Well, then I can play pretend
Technical Details
Message-ID: <2589391E.18239@maccs.dcss.mcmaster.ca>
Path: arc1-ca.pugleaf.net!utzoo!attcan!lsuc!maccs!cs4g6ag
References: <89345.110313MHS108@PSUVM.BITNET>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!lsuc!maccs!cs4g6ag
From: cs4g6ag@maccs.dcss.mcmaster.ca (Stephen M. Dunn)
Newsgroups: comp.sys.ibm.pc
Subject: Re: Redirection and piping
Message-ID: <2589391E.18239@maccs.dcss.mcmaster.ca>
Date: 15 Dec 89 18:34:05 GMT
References: <89345.110313MHS108@PSUVM.BITNET>
Reply-To: cs4g6ag@maccs.dcss.mcmaster.ca (Stephen M. Dunn)
Organization: McMaster University, Hamilton, Ontario
Lines: 38