[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] File/Folder Iteration



I've been working for quite awhile to write a program which will, with the
entry of a root directory, find the size of all of the folders residing in
that directory, without using AppleEvents to ask the finder, which is
really slow. =)

The idea I had was to take the root directory (in this case, "root"), and
readdir's it. It adds the root directory to the "path" variable, and for
each of its subsequent (using -d) directories, it uses the &iterate
function, which essentially does this:

takes the directory sent to it
adds it to the "path" variable
readdir's the new path
adds the file sizes to a 'total' variable
&iterate's for each directory in path
returns total size

I need to know if there's something basically wrong with this system.
Debugging says that I go 100 deep in recursions on my first iteration
(maybe I'm misintepreting that- probably, in fact) and I'm thinking of
using a slightly different system that doesn't involve returning variables,
and therefore uses less memory in my() variables for each iteration.

At any rate, if anyone has a better idea, please let me know.

I've tried the (toolbox?) command that iterates through the directories,
but I couldn't get it to work. If anyone has any ideas on that too, I could
really use them.

Thanks,
Strider



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch