I'm trying to truncate a very large file with simple Perl script below. It works fine with files less than 4GB, but returns "Invalid argument" error with larger files. I cannot find any limit for truncate function in perldoc or with google.
I'm running Active Perl 5.10 on Windows XP SP2, 4GB ram, NTFS file system.
my $filename = "c:/temp/test.dat";# the test.dat file size is 4585291776my $length = 4000000000;truncate $filename, $length or die "Couldn't truncate: $!\n";