Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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 contemplating the Monastery: (3)
As of 2015-07-28 02:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (251 votes), past polls