Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!uw-june!uw-entropy!uw-apl!keith From: keith@uw-apl.UUCP (Keith Kerr) Newsgroups: comp.sys.mac.programmer Subject: i.o. problem with MPW C Keywords: MPW, C Message-ID: <222@uw-apl.UUCP> Date: 28 Mar 89 18:07:59 GMT Distribution: na Organization: UW Applied Physics, Seattle Lines: 44 I've just started using MPW C, and I'm having a problem with very simple i/o. I've tried several variations of the following program (which runs fine on UNIX), but without success. The output file gets created, but upon completion it is either empty, or unreadable. Any pointers as to what I'm doing wrong would be helpful. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- #include /* for buffered file output */ int main() /* prints out data to check it */ { FILE *out_file, *fopen(); char *filename = "HD-0:MPW:HistoC:check_file_out"; int how_much = 64, index, ok; out_file = fopen(filename, "w"); if (out_file == NULL) { /*SysBeep(5);*/ return; } else for (index = 1; index <= how_much; ++index) fprintf(out_file, "This shoulda been %d\n", index); ok = fclose(out_file); if (ok == (-1)) { return; /*SysBeep(5);*/ /*SysBeep(5);*/ } return(0); } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - I've tried this with no type dec. for main, with no return, with no explicit close, etc. H E L P!!