sanjib kumar ghorui wrote:
> Friends!
>    
>   I need a urgent help for the following issue.
>    
>   I tried to open a large file that was bigger than 2 GB - it was 3 GB. The 
> code calls a file management subsystem (the SPI directory routines) that use 
> the C STDIO Library routines. These routines appear to be using a 4 byte word 
> to hold the offset from the front of the file (in binary form 31 signed bits 
> has a limit of about 2 GB).
>    
>   After the input file has been read, the data to be stored is much smaller 
> and so the issue only applies to input file processing.The actual failure was 
> in fopen and I think the containing C Library is called STDIO.
>    
>    There may be another set of library routines that already support greater 
> than 2 GB in C/C++;
>    
>   Please help me....
>    
>   Thanks in advance,
>   Sanjib

This is exactly one of the reasons why the ANSI C/C++ committees should 
not be in the business of defining library function calls.

You have hit what is known as the 32-bit limitations of the ANSI C 
library for your compiler.  You will have to switch to OS-specific APIs 
to get the code to work.  Under Linux, look at fopen64() and related 
calls.  Under Windows, look at CreateFile() (or, if you get lucky, your 
compiler will have 64-bit file I/O stuff).

-- 
Thomas Hruska
CubicleSoft President
Ph: 517-803-4197

*NEW* MyTaskFocus 1.1
Get on task.  Stay on task.

http://www.CubicleSoft.com/MyTaskFocus/

Reply via email to