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

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;


Comment on Re: comparing size
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (11)
As of 2015-06-02 20:09 GMT
Find Nodes?
    Voting Booth?

    What kind of chocolate gives you the most pleasure?

    Results (108 votes), past polls