if condition and big-size file

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.
 
U

usenet

Binary said:
It is Perl5.

Perl 5-what?

Run this command and post the output:

perl --version

I have a sneaky suspicion this is on AIX 4.3x or something like that...
 
B

Ben Morrow

Quoth "Binary said:
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.

Is you perl built with uselargefiles? That is, does

perl -V;uselargefiles

print

uselargefiles='define';

? If not, you will need to recompile perl with that option to use files
larger than 2G.

Ben
 
B

Ben Morrow

Quoth Ben Morrow said:
Is you perl built with uselargefiles? That is, does

perl -V;uselargefiles

Sorry, typo. I meant

perl -V:uselargefiles

(with a colon).

Ben
 
U

Uri Guttman

BM> Is you perl built with uselargefiles? That is, does

BM> perl -V;uselargefiles

s/;/:/ ;

:)

uri
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,289
Messages
2,571,435
Members
48,121
Latest member
ColinHibne

Latest Threads

Top