Max Single File Size

Rick Stevens rstevens at vitalstream.com
Thu Apr 7 22:09:16 UTC 2005


Linux Beginner wrote:
> Hello Team
> 
> What is the max.single file that Linux FC2 supports on Intel
> Desktop (dual boot) 32-Bit?  Is that 2GB? 

Nope.  The largest file is defined by the second parameter of the
"lseek()" call, which is defined as type "off_t".  An "off_t" is a
64-bit signed integer.  Since you can only use the positive part of
that as the file size (to permit seeking backwards in a file), the
maximum file size is 2^63 or 9 * 10^18 bytes.

The problem is that many applications still mistakenly use "int" (32-bit
signed integer) instead of off_t for that parameter.  2^31 is 2 * 10^9
or 2GB, so that's where the limit comes from.
----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-      Do you know how to save five drowning lawyers?  No?  GOOD!    -
----------------------------------------------------------------------




More information about the users mailing list