Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!att!dptg!ulysses!ucbvax!DMZRZU71.BITNET!Ritzert From: Ritzert@DMZRZU71.BITNET Newsgroups: comp.sys.atari.st Subject: help with io redirection, please! Message-ID: <900222005804.790174@DMZRZU71-UNI-MAINZ--GERMANY> Date: 22 Feb 90 00:58:00 GMT Sender: usenet@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 57 hi, I don't understand why redirecting the input of Cconrs() doesn't work. Here is a simple example of what I'm trying to do (compilers: Laser C 1.2, GCC 1.34): /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ /* redirect stdin and pexec the program that shall do the real work */ /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include main() { int fp; if( (fp = Fopen("d:\\egs\\system\\base\\ll.g",0)) < 0 ) { Cconws("Fopen\n"); Pterm(fp); } if( (fp = Fforce(0,fp)) < 0 ) { Cconws("Fforce\n"); Pterm(fp); } if( (fp = (int)Pexec(0,"testt.prg","","")) < 0 ) { Cconws("Pexec\n"); Pterm(fp); } } /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ /* testt --- silly demonstration program: */ /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include main() { char buf[123]; buf[0] = 121; for(;;) { Cconws("? "); Cconrs(&buf[0]); Cconws("\r\n");Cconws(&buf[2]);Cconws(" !\r\n"); } } /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ If I remember correctly from the previous discussions of io-redirection, this code should work (it does work when I try to redirect stdout). But it doesn't. Instead, the demo program still waits for input from the keyboard. What am I doing wrong, what is the correct way to redirect the input to Cconws() ? BTW, the Absoft librarian also uses Cconrs() to read its commands... Thanks for any comments Michael Ritzert mjr@dmzrzu71.bitnet