Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: getting filesize in windows

by thinker (Parson)
on Aug 23, 2003 at 10:06 UTC ( [id://286038]=note: print w/replies, xml ) Need Help??


in reply to getting filesize in windows

Hi peamasii,

Here is a one liner that will look at all the files under your current directory, and sum the sizes of all files ending in mp3 (or Mp3 or MP3 etc)

The quotes may need changing for Window's though. I have no means of checking here, but it should be ok to insert into a script

perl -MFile::Find -le 'find ( sub { $s+= -s if /mp3$/i },  "." );print "size $s"'

cheers

thinker

Replies are listed 'Best First'.
Re: Re: getting filesize in windows
by Chady (Priest) on Aug 23, 2003 at 10:41 UTC
    And since it's on windows, use this version:
    perl -MFile::Find -le "find ( sub { $s+= -s if /mp3$/i }, '.' );print +'size ',$s"

    He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.

    Chady | http://chady.net/
      The sample worked. In fact I went back to doing this with File::Recurse because the rest of the code used that package. But File::Find essentially did the same recursive search. Thanks

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-03-29 11:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found