Determine if a filename exists in a LARGE folder
Determine if a filename exists in a LARGE folder
- Subject: Determine if a filename exists in a LARGE folder
- From: Matthew Broms <email@hidden>
- Date: Wed, 13 Jun 2001 12:41:16 -0400
I have a bit of a unique problem. I have a script that processes a large
batch of post cards that go out to customers. Each post card has a space
for a signature. This signature is a graphic that either is or is not on
file in a folder.
I was going to get a list of filenames in a designated folder and see if
this list contained "xyz" filename (easy - works well). The problem is that
this folder is 11 gigabytes in size and currently contains 42,225 items in
it. Getting a list this size is rather slow and the list is VERY large
given such a large folder (and there is no way I'm able to break this folder
down into more manageable sub-folders since this folder is referenced by 3+
Indigo printers). Does anyone know how to efficiently (that is, reasonably
fast) check for the mere existence of a filename in such a large folder? My
experience is that the Mac OS Finder doesn't deal very quickly with folders
that have such a large number of files. Doing a straight reference to the
file directly is slow too - in a try statement I did a "set test to info for
alias fileNamePath" and set it to a default signature on error. This worked
properly, but just crawled along. Any suggestions?
Thanks,
Matt
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~