Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!munnari.oz.au!brolga!bunyip.cc.uq.oz.au!marlin.jcu.edu.au!glmwc From: glmwc@marlin.jcu.edu.au (Matt Crowd) Newsgroups: comp.sys.amiga.programmer Subject: C questions (again) Message-ID: <1991Feb7.114348.10577@marlin.jcu.edu.au> Date: 7 Feb 91 11:43:48 GMT Organization: James Cook University Lines: 52 Ok, I've just about given up after only getting 1 reply to the problem with 2 programs not working with SAS 5.1 system() call. I've changed the programs around to this : (couldn't avoid the Amiga specific code) Program1 : #include #include #include struct DosBase *DosBase; main() { struct FileHandle *input; if(!(DosBase = (struct DosBase *) OpenLibrary("dos.library"))) { printf("Open lib failed.\n"); exit(0); } input = (struct FileHandle *) Input(); // get filehandle of stdin printf("This is program 1!\n"); Execute("program2",input,0); // run program2 printf("Because of something very wierd, this line " "will not be printed. I do not know why.\n"); } Program2: #include char buff[200]; main() { scanf("%s",buff); printf("String was - %s\n",buff); } What is going on? Now I can get the scanf to work, but output and input disappears from program 1. I think that program 2 must be closing stdin/stdout when it finishes, but putting an abort/Exit at the end of program 2 didn't work either. How can I keep the input/output? This is for a larger program but if I could solve this simple example it would work in the larger case. Does this mean I have no choice but to learn how to use the CON: device and get the address of the CLI window etc. etc. etc.??? I am new to Amiga specific coding and my experiences so far indicate it's not going to be much fun..... Help! Thanks, Colin Adams