home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 5610 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: mail2news.demon.co.uk!etchq.demon.co.uk
  2. From: MushyPea <MushyPea@etchq.demon.co.uk>
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: File/Pipe/Console IO
  5. Followup-To: poster
  6. Date: Sun, 17 Mar 96 15:31:41 GMT
  7. Message-ID: <9603171531.AA002ox@etchq.demon.co.uk>
  8. Reply-To: MushyPea@etchq.demon.co.uk
  9. X-NNTP-Posting-Host: etchq.demon.co.uk
  10. X-Newsreader: ADMaN 1.7 Copyright 1995 S.T.Brown
  11. X-Mail2News-Path: relay-4.mail.demon.net!post.demon.co.uk!etchq.demon.co.uk
  12.  
  13. Hiya, ppl,
  14.  
  15. I am trying (and, so far, failing) to write a program that does something
  16. very simple...
  17.  
  18. Imagine you have 2 input file handles, A and B.
  19. Imagine you also have 2 output file handles, C and D.
  20.  
  21. I want to copy any incoming data from input A to output C.
  22. I also want to copy any data from input B to output D.
  23. Most importantly, I want to run both in parallel.
  24.  
  25.  
  26. How do I go about this?  I've tried using Read()/Write(), but the program
  27. appears to pause at the Read() if there is no input from one of the inputs,
  28. which means that the other input is left waiting, even if it has data.
  29.  
  30. Can anyone suggest any way of writing a program to transfer data between two
  31. pairs of filehandles simultaneously?  Assembler code would be preferred,
  32. although C/C++ is just as useful.
  33.  
  34. Thanks in advance.
  35.  
  36. -- 
  37. MushyPea/EtCetera (Ian Marsh) [680x0 coder, musician]      ___MMM___
  38. Email: MushyPea@etchq.demon.co.uk (EtCetera HQ)              (O O)
  39. -WWW-: http://www.cus.umist.ac.uk/~mushypea/          ---oOO--(_)--OOo---
  40. A1200-030 10Mb SCSI2 700MbHD 3xCD 28800Vfc PGPv2.6ui
  41.  
  42.