Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: comparing size

by gav^ (Curate)
on Aug 19, 2002 at 14:19 UTC ( #191184=note: print w/ replies, xml ) Need Help??


in reply to comparing size

To find the size of a file you can use: my $size = -s $file;
The -X file tests are documented here.

You could also use the core module File::stat which provides dev, ino, mode, nlink, uid, gid, rdev, size, atime, mtime, ctime, blksize, and block. I tend to find this easier than remembering what order stat returns things.

use File::stat; my $st = stat($file); my $size = $st->size;

gav^


Comment on Re: comparing size
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2014-08-30 00:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (289 votes), past polls