home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / aix / 11670 < prev    next >
Encoding:
Text File  |  1992-11-17  |  1.3 KB  |  46 lines

  1. Newsgroups: comp.unix.aix
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!rpi!ghost.dsi.unimi.it!univ-lyon1.fr!chx400!aragorn.unibe.ch!iacrs1!haedener
  3. From: haedener@iacrs1.unibe.ch (Konrad Haedener)
  4. Subject: Re: Simple EOF problem?
  5. Message-ID: <1992Nov18.074916.2886@aragorn.unibe.ch>
  6. Sender: haedener@iacrs1 (Konrad Haedener)
  7. Reply-To: haedener@iacrs1.unibe.ch
  8. Organization: University of Berne
  9. References:  <BxvzEE.79B@acsu.buffalo.edu>
  10. Date: Wed, 18 Nov 1992 07:49:16 GMT
  11. Lines: 33
  12.  
  13. In article <BxvzEE.79B@acsu.buffalo.edu>, vidya-v@acsu.buffalo.edu (vidyaranya) writes:
  14. |> 
  15. |> The following piece of code FAILS to detect End of File
  16. |> under AIX(i dont know the version currently!) running on
  17. |> an IBM PowerServer 970.
  18. |> ------
  19. |>     char    buffer[2048];
  20. |>     int    i;
  21. |>     FILE    *fp;
  22. |> 
  23. |>     i=0;
  24. |>         while( (buffer[i++]=fgetc(fp))!= EOF )
  25. |>          ;
  26. |> ------
  27. |> Exactly same piece of code runs on a SparcStationIPC running
  28. |> SunOS 4.1.2 .
  29. |> 
  30. |> What could be the problem?
  31.  
  32. fgetc returns int.
  33. EOF is (-1).
  34.  
  35. |> 
  36. |> Thanks.
  37. |> 
  38. |> Vidyaranya
  39. |> vidya-v@acsu.buffalo.edu
  40.  
  41. -- 
  42. Konrad Haedener                             Phone: +41 31 65 42 25
  43. Institute for Physical Chemistry            FAX:   +41 31 65 39 94
  44. University of Berne
  45. Switzerland                                 haedener@iacrs1.unibe.ch
  46.