[lug] File size limit issue

rm at mamma.varadinet.de rm at mamma.varadinet.de
Sun Nov 19 13:03:25 MST 2000

On Sun, Nov 19, 2000 at 11:43:25AM -0600, G. Mallén wrote:
> I've done my homework regarding maximum file size in Linux.
> The 2 GB limit comes from the fact that C uses a long integer (signed) to store
> the position of the file where you are reading/writing. 2 GB is 2^31 (the other
> bit is used for the sign, IMO a stupid thing in this case).

Hmm, maybe, but according to my manpages fseek  behaves as

                                ...  The new position, mea­
 sured in bytes, is obtained by adding offset bytes to  the
 position  specified  by  whence. ... 

How would you seek to a position 64 bytes before the end of
file without negative offset?


> This is obvious in the fseek and fpos man page:
>        #include <stdio.h>
>        int fseek( FILE *stream, long offset, int whence);
>        long ftell( FILE *stream);
> Some databases use raw disks to overcome this limitation.
> With the modern huge disks this should change, but I don't know if there is
> someone working on the problem.
> Regards
> Guillermo
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug

More information about the LUG mailing list