Path: utzoo!attcan!uunet!cs.utexas.edu!usc!rutgers!mcnc!uvaarpa!murdoch!krebs.acc.Virginia.EDU!wrp From: wrp@krebs.acc.Virginia.EDU (Bill Pearson) Newsgroups: comp.sys.mac.programmer Subject: MPW-C stdio buffering Message-ID: <1990Jan13.203040.13336@murdoch.acc.Virginia.EDU> Date: 13 Jan 90 20:30:40 GMT Sender: news@murdoch.acc.Virginia.EDU Reply-To: wrp@krebs.acc.Virginia.EDU (Bill Pearson) Organization: Academic Computing Center, University of Va. Lines: 25 Ireallyam: wrp I would like to convert a program from unix to MPW-C. I have managed to get the program to work pretty well under the MPW shell, but am having a terrible time with file buffering on stdin and stdout. If I prompt for a response without a '\n', e.g.: printf(" enter filename: "); and follow it by: fgets(reply,sizeof(reply),stdin); reply contains: enter filename: filename-that-was-typed This is awful. If I put a "\n" after enter filename, everything is OK. This happens regardless of whether I do a: setvbuf(stdout,NULL,_IONBF,0); setvbuf(stdin,NULL,_IONBF,0); Is there any trick that I can do to resolve this problem, short of putting lots of '\n''s in every prompt? Bill Pearson wrp@virginia.EDU