Opening a file for reading in C: "File too large" error
- From: pedro.ballester@xxxxxxxxx
- Date: 27 Nov 2006 16:39:22 -0800
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;
}
.
- Follow-Ups:
- Re: Opening a file for reading in C: "File too large" error
- From: Måns Rullgård
- Re: Opening a file for reading in C: "File too large" error
- Prev by Date: Re: Pthread ThreadPool
- Next by Date: Re: Opening a file for reading in C: "File too large" error
- Previous by thread: Pthread ThreadPool
- Next by thread: Re: Opening a file for reading in C: "File too large" error
- Index(es):
Relevant Pages
|