Sevenforge Sevenforge by Curtis Spencer home

fopen error "Value too large for defined data type"

November 20, 2008

Was working with some large data files from Wikipedia in C, and got a NULL pointer from fopen. After checking strerror, I got the “Value too large for defined data type.” error. The solution. Put the following definition at the top of your .c file and it will set you straight.

#define _FILE_OFFSET_BITS 64

Fork me on GitHub