On Tue, 05 Jun 2012 10:16:11 +1000 Graham Cox  wrote:
> 
> I do something similar to map an SVG file to its thumbnail image, which is 
> costly to generate, and is stored separately from the original file.
> 
> Once I've created the thumbnail (or whatever data you want to associate with 
> the file), I make a dictionary with the original file's URL as the key and a 
> UUID string as the value. The UUID is then used as the filename for the 
> thumbnail, which is stored in my Application Support folder. The dictionary 
> is written out to a plist in the same location. Using a UUID avoids any 
> possibility of accidentally creating a filename that clashes with one written 
> earlier. The users never has to see these files so the obscure names don't 
> matter.

> I don't bother culling out thumbnail files that are never needed (if the 
> original file is deleted for example), I just let the cache grow as disk 
> space is super-abundant. 

Am I right in thinking that if the finder is used to move or duplicate the 
original file or a containing folder name is changed, you then need to 
re-create the thumbnail?
If so then this is an interesting example of using memory to simplify program 
logic.
Julius


http://juliuspaintings.co.uk



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to