Path: utzoo!attcan!uunet!husc6!psuvax1!psuvm.bitnet!cunyvm!ndsuvm1!ndsuvax!numork From: numork@ndsuvax.UUCP (James Mork) Newsgroups: comp.lang.c Subject: What is wrong? Message-ID: <2051@ndsuvax.UUCP> Date: 24 Jan 89 02:08:40 GMT Reply-To: numork@ndsuvax.UUCP (James Mork) Distribution: na Organization: North Dakota State University, Fargo Lines: 25 --- #include main(){ FILE *fi, *ji; int i,j; fi=fopen("b:newtest.fil","w"); for(i=0; i<200; i++) { j=putc(i,fi); printf("putting %d %d\n", i,j);}; i=fclose(fi); printf("opening file for read...\n"); ji=fopen("b:newtest.fil","r"); for(i=0; i<200; i++) printf("i = %d (read) = %d\n",i,getc(ji)); i=fclose(ji); }; --- I am using TC 1.5 everything was going OK... Now... when I run a simple program like this, the file gets truncated after 25 or 26 bytes... After 25 when I read the file back in, I just get EOF (-1). What is wrong? Is this just some error that I am staring at, or is my compiler in foo bar land? --- -- UUCP Bitnet Internet uunet!ndsuvax!numork numork@ndsuvax numork@plains.nodak.edu #! rnews 597 Path: psuvm.bitnet!cunyvm!nyser!cmx!