Max file Size for fwrite() function

Alain Baeckeroot alain.baeckeroot at laposte.net
Tue May 26 06:46:08 CDT 2009


Le 26/05/2009 à 13:03, David Kremer a écrit :
> > David,
> > 
> > Can you provide a simple example demonstrating the problem?
> > 
> > Ben
> > 
> > 
> Yes, surely :
> 
> %%%% Beginning of octave script
> %%  Demonstrating impossibility to write more than 2Go by a single file
> %% Be care of space disk available (must be > 2 Go)
> fd = fopen( "test.bin" , "wb" ) ;
> for k = [ 1:300 ]
>     fwrite( fd , randn(1024,1024) , "double");
> end ;
> fclose( fd ) ;
> 
> ls -lh
> 
> % 'double' on x86 platform is 8 octets big, so each randn(1024,1024)
> % call gives a 8 Mo matrix size. So, 300 matrix is 300x8 = 2400 Mo, 
> % which is larger than 2Go. Please try, and read the exact size of 
> % 'test.bin' to check if your file is bigger than 2 Go. 
> 


i also have 2.0 GB limit on debian lenny, for both octave 3.0.1 (debian)
and 3.1.55 that i builded some times ago.

-rw-r--r-- 1 al al 2,0G mai 26 13:40 test.bin

Tested on two different ext3 filesystems, where i have other files bigger
 than 2.0 GB.

Alain.





More information about the Help-octave mailing list