Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: How can I determine the size of a file?

by BastardOperator (Monk)
on Sep 25, 2000 at 19:55 UTC ( #33919=note: print w/replies, xml ) Need Help??


in reply to How can I determine the size of a file?

I'm guessing that you wanted to do this from a cgi, right?

Assuming that the file is:
A) within the chroot jail made by Apache
B) readable by the user

you can do something like
my $file = "some/file"; # relative path within chroot my $fsize = (stat($file))[7]; # in bytes
<!- Added CODE tags, changed title (turnstep) -->

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2021-05-12 11:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (126 votes). Check out past polls.

    Notices?