• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to know if a file has been opened before?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to know if a file has been opened before?


  • Subject: Re: How to know if a file has been opened before?
  • From: julius <email@hidden>
  • Date: Tue, 05 Jun 2012 13:51:47 +0100

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 (email@hidden)

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: How to know if a file has been opened before?
      • From: Graham Cox <email@hidden>
  • Prev by Date: Re: CoreData, automatic migration and sandbox problems.
  • Next by Date: Re: adding space for 'annotations' with a typesetter subclass
  • Previous by thread: Re: How to know if a file has been opened before?
  • Next by thread: Re: How to know if a file has been opened before?
  • Index(es):
    • Date
    • Thread