Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: file test operation on files greater than 2gigs

by Corion (Pope)
on Aug 01, 2013 at 10:49 UTC ( #1047420=note: print w/ replies, xml ) Need Help??


in reply to file test operation on files greater than 2gigs

Besides recompiling Perl, the only way is to call the OS tools, which hopefully know how to deal with file sizes larger than 32 bit:

my $output= `ls -l "$filename"` # Parse the output of ls


Comment on Re: file test operation on files greater than 2gigs
Download Code
Re^2: file test operation on files greater than 2gigs
by Anonymous Monk on Aug 01, 2013 at 11:50 UTC
    Probably better to use the output of stat(1). Trying to parse ls(1) is well known to be a bad idea.
    my $size = `stat -f %z yourfile.txt`;
      ...except that the GNU version uses -c %s for the format string argument. Ah well. Portability woes everywhere.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1047420]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2014-12-27 02:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls