B
Binary
I am new here. Could somebody help me out?
I encountered a problem when using if-statement to check if a file
exists or not. This Perl program always tells a flat file does NOT
exist even though it exists but is large, e.g. 2GB. I have tested many
different text files and got same result. Different options such as
"-r", "-L", "f", etc, were tested.
Here is the piece of program:
--- cut here ---
$fileName="/usr/local/mydata/sample.data";
if (! -e "$fileName")
{
print "\tThe file 1 does not exists \n\n";
return 1;
}
print "\tThe file 1 exists \n\n";
return 0;
--- cut here ---
When the file is not too large, for example about 2GB, "The file 1
exists" is displayed. But if the file is large than 2GB, "The file 1
does not exists" is displayed.
It is Perl5.
I encountered a problem when using if-statement to check if a file
exists or not. This Perl program always tells a flat file does NOT
exist even though it exists but is large, e.g. 2GB. I have tested many
different text files and got same result. Different options such as
"-r", "-L", "f", etc, were tested.
Here is the piece of program:
--- cut here ---
$fileName="/usr/local/mydata/sample.data";
if (! -e "$fileName")
{
print "\tThe file 1 does not exists \n\n";
return 1;
}
print "\tThe file 1 exists \n\n";
return 0;
--- cut here ---
When the file is not too large, for example about 2GB, "The file 1
exists" is displayed. But if the file is large than 2GB, "The file 1
does not exists" is displayed.
It is Perl5.