Mail Archives: djgpp/1996/08/14/17:44:05
Joonas W N Reynders wrote:
>
> My question is that does fread have a limit in the number of
> bytes it can read on one call? If I try to read more than about 130000
> bytes I get EOF on a file which is 890000 bytes long (read starts from
> the beginning, I've checked it with ftell). The size of read unit is one
> byte.
No. I checked the source for fread (in DJGPP/SRC/LIBC/ANSI/STDIO), which
does not limit in any way the number of bytes read. Also, I wrote a small
program which smoothly read 1000000 bytes with one fread().
What did you use to open your file ?
It should be
fopen("myfile.sth","rb");
^^^^^
on my machine, if you say :
fopen("myfile.sth","r");
^^^^^
your file is opened as a text file, and fread() does not work as you
wish... (I think this default attitude can be corrected by fixinf
something in a .h header).^
Francois,
- Raw text -