Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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^

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 scrutinizing the Monastery: (7)
As of 2016-08-30 08:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (414 votes). Check out past polls.