Opening a file for reading in C: "File too large" error



Dear all,

The following is a simple program that works well on Windows, but fails
to open a file of 6.5GB for reading on Linux Red Hat. The reported
error is "File too large".

If anyone knows how to fix this, I will be very grateful.

Best wishes,

Pedro

Ps: the problem is confined in the following code

#include <math.h>
#include <stdio.h>
#include <stdlib.h>

#define SDF_DBFILE "very_large_file.sdf"

int main(void)
{
FILE *finput;

finput = fopen(SDF_DBFILE, "r");
if(finput == NULL)
{
perror("Error");
fprintf(stderr, "\n CANNOT OPEN %s", SDF_DBFILE);
}
else printf("I CAN OPEN %s", SDF_DBFILE);

fclose(finput);

getchar();

return 0;
}

.



Relevant Pages

  • Re: Opening a file for reading in C: "File too large" error
    ... The following is a simple program that works well on Windows, but fails ... to open a file of 6.5GB for reading on Linux Red Hat. ...
    (comp.os.linux.development.apps)
  • Re: Opening a file for reading in C: "File too large" error
    ... The following is a simple program that works well on Windows, but fails ... to open a file of 6.5GB for reading on Linux Red Hat. ...
    (comp.os.linux.development.apps)
  • Re: Got Vista or Win7? Worry.
    ... Do you really think people will switch to Ubuntu because of cries of worry with Vista and Windows 7? ... If you do insist on staying in all the time, try some reading instead of planting your nose, inside your computer, all of your life. ... Also knowing quite a few MVP's and other REAL EXPERTS in the industry helps. ... There input is invaluable and as I said before, I have heard nothing but good reports about it. ...
    (microsoft.public.windows.vista.general)
  • Media Player Hangs with Hyper-Threading On
    ... We discovered a unique situation where the Windows Media ... the system never fails. ... Colorgraphic Xentera GT (AGP Card) - 2 channels ...
    (microsoft.public.windowsmedia.player)
  • RE: File Transfer Wizard Problem
    ... Started reading your post and thought it was mine, ... Windows SE computer right here next to the new big one. ... Tried direct cable connection and could see the ... > Thanks, Ron ...
    (microsoft.public.windowsxp.general)