[comp.os.msdos.programmer] io redirection

Rob.Wedlock@samba.acs.unc.edu (Rob Wedlock) (12/24/90)

Hi & happy holidays!

 Im trrying to write a short prgram in assmebler, briefly, it:
1. read in a file name using int 21 func 3fh handle 1 (stdin)
2. convert that string to asciiz
3. open the file with int 21 func 3dh ( and exit if err, i.e. carry)
4. dump out the file by reading with func 3fh, and writing to stdout
   (handle 1) with function 40h.
5. close the file with func 3eh
6. exit with func 4ch

  Now this does EXACTLY what it should when called from the dos prompt
  at my computer. 

  However, under the following circumstances, it reads no filename at step 1
  therefore, exits at step 3:
1. When run from a dos shell on com2 on another machine.
2. With output redirected to a file, e.g. C:>dumpfile >test.txt

I thought for sure writing to stdout would take care of this automatically?
Can somone point me in the right direction for an answer???
thanks!