[ale] 2 Perl questions ?
Courtney Thomas
ccthomas at joimail.com
Wed Dec 15 09:15:12 EST 2004
Purpose:
write a small program that will process all files in a designated dir, which
contains files and dirs, by examining each file entry and sums it to a
total, which is less than some arbitrarily entered size, [in this case
<=650MB since the purpose is to aggregate chunks of the original dir into
separate dirs <=650MB for burning to a CD], and if the total <=650MB,
then, move that entry into the new "burn" dir, and continue until a
total <=650MB is reached, then stop.
In this way I can take an arbitrary size dir and allocate it to any
number of burn dirs of <=650MB, then burn 'em.
-------------------------------------------------------------------------
2 Problems:
1-The compiler is complaining about uninitialed variables within a
"while" loop. How do I properly initialize numeric variables within the
loop ?
2-I also need to traverse a dir that itself contains dirs, processing
each file and dir. How do I traverse such a dir such that....when a dir
is encountered it is entered and all the files in it are then processed,
and if necessary drills down through other dirs [howto control depth
?]...before returning to the original dir that contained files and dirs ?
--------------------------------------------------------------------------
Appreciatively,
Courtney
--
s/v Mutiny
Rhodes Bounty II
lying Oriental, NC
WDB5619
More information about the Ale
mailing list