On Feb 8, 2008 1:34 PM, mano M <[EMAIL PROTECTED]> wrote:

>
>  In my c program I am trying to open huge file of 5GB . But fopen returns
> failure . But I am able to open by vi editor (it takes around 3 minutes) .
>  Is it possible to open big file using fopen  . Any soln ?
>

Depending on the compiler and/or, you may need to use fopen64 for opening
large files (>2G) or put these defines in your source file:

#define _LARGEFILE_SOURCE
#define _FILE_OFFSET_BITS 64

(These are Linux specific, I think, other OSes may have different ways of
doing it).

A quick Google may help for other options.

-- Brett
------------------------------------------------------------
"In the rhythm of music a secret is hidden;
   If I were to divulge it, it would overturn the world."
              -- Jelaleddin Rumi


[Non-text portions of this message have been removed]

Reply via email to