Re: why does this file info lister work sometimes, not others
Re: why does this file info lister work sometimes, not others
- Subject: Re: why does this file info lister work sometimes, not others
- From: Axel Luttgens <email@hidden>
- Date: Fri, 14 Sep 2001 09:33:27 +0200
- Organization: ---
Your code "works": I've tried it as is on small folders.
You seem to point problems as soon as a great number of files are involved.
One possible cause: 'bigList' may become very... big.
There is an upper limit to the number of items a list may have (don't remember how
much exactly; should be around 4,000).
You could get more info about this by writing 'display dialog error_message' instead
of 'display dialog "oops"'.
More generally, your script is liable to encounter insufficient memory conditions
(remember that Script Editor has a default memory allocation of 1,500K, and that the
one for an applet is of 200K). While running, it has to have storage enough for three
potentially large items:
FileList <- entire contents of some folder
bigList <- file info records of every file in FileList
output <- bigList coerced to a string
You could consider to review the flow of your script (pseudo-code):
open a file for writing
for each file in entire contents of a given folder
write the file's info as text
end
close the file
That way, the only memory-hungry part of your code would reside in the 'entire
contents of' part. And this could even be optimized by considering a recursive routine
that parses the contents of initial folder, by parsing the contents of sub-folders if
any, etc.
Hope this helps.