• 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: newbie q - referencing files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: newbie q - referencing files


  • Subject: Re: newbie q - referencing files
  • From: Doug Wyatt <email@hidden>
  • Date: Wed, 23 Oct 2002 09:24:29 -0700

Don't store FSRefs -- it's not guaranteed that one will be valid if you save it to persistent storage and re-load it.

Save a URL, Posix path, or contents of an AliasHandle (which is what I still prefer because it will find the file if it gets moved to a different folder).

e.g. save:
AliasHandle ah;
OSErr err = FSNewAlias(NULL, &theTargetFSRef, &ah);
UInt32 aliasSize = GetHandleSize((Handle)ah);
HLock(ah);
Byte *aliasPtr = (Byte *)*ah;
...

Doug


On Wednesday, Oct 23, 2002, at 00:38 US/Pacific, Urs Heckmann wrote:
Hi Art & Carsten,

thanks for the info. I'm sure this will have saved me a lot of hassle!

I store everything I need to recreate an FSSpec in my plug-ins.

I would store FSRefs (or posix paths/CFURL) in the ClassInfo's 'data' property.


--
Doug Wyatt
work: email@hidden (CoreAudio)
personal: email@hidden http://www.sonosphere.com
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: newbie q - referencing files
      • From: Carsten Gehle <email@hidden>
References: 
 >Re: newbie q - referencing files (From: Urs Heckmann <email@hidden>)

  • Prev by Date: Re: Filing of User Presets
  • Next by Date: Re: Filing of User Presets
  • Previous by thread: Re: newbie q - referencing files
  • Next by thread: Re: newbie q - referencing files
  • Index(es):
    • Date
    • Thread