Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!cs.utexas.edu!usc!ucsd!net1!corrigan From: corrigan@net1.ucsd.edu (Mike Corrigan) Newsgroups: comp.sys.hp Subject: Re: Strange behaviour on HP9000/825 Keywords: errno 25 cc errors Message-ID: <1867@ucsd.EDU> Date: 28 Jul 89 00:20:40 GMT References: <227@innovus.UUCP> Sender: nobody@ucsd.EDU Reply-To: corrigan@net1.UUCP (Mike Corrigan) Organization: UCSD Network Operations Group Lines: 15 In article <227@innovus.UUCP> martin@innovus.UUCP (Martin Renters) writes: > printf("File opens, errno=%d, fp=%d\n",errno,fp); /* > fgets(buffer,64,fp); > printf("File read, errno=%d, fp=%d, buffer=%s",errno,fp,buffer); */ Should go like: while(fgets(64,fp) != NULL) printf("File read, buffer=%s",buffer); if(!feof(fp)) { fprintf(stderr,"ERROR detected on File read\n"); exit(ferror(fp)); }