Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2Gb file limitations in perl 5.8.8

Status
Not open for further replies.

meteol

Technical User
Feb 2, 2008
1
0
0
IT
Dear Sir,
I'm a newbie running a perl 5.8.8 application making an incremental txt file stop growing at 2 GB of size. I have settled-up uselargefiles=define to work with larger file but i'm not so skilled infact the application is still blocking at 2 Gb. The application is running on Ubuntu 7.10 server dsik partition EXT3. Idea how the set the perl module or other setting to do
Tks Paolo
 
Are you using a module? Perl 5.8.8 doesn't have a file size limit. I wrote a script that writes a 5.0 GB file:

Code:
#!/usr/bin/perl -w

print "Creating large file.\n\n";

open (WRITE, ">large-file.txt");

my $bc = 0;
my $mb = 0;
my $stop = (1024**3) * 5;

while ($bc < $stop) {
	# Write a megabyte at a time.
	print WRITE "x" x (1024 * 1024);
	$bc += 1024*1024;
	$mb++;

	print "Written $mb MB ($bc bytes)...\n";
}

print "\nDone.\n";
close (WRITE);

It ran just fine. This is on Linux on an ext3 filesystem.

-------------
Cuvou.com | My personal homepage
Project Fearless | My web blog
 
when you build perl there is a uselargefiles configuration setting. But he says his is set to define which should allow for large files (as far as I know).

You can check it:

perl -V:uselargefiles

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top