Re: [toolbox] aliases vs. paths (was: Extended Attributes)
Status: Planning
Brought to you by:
jlaurens
From: Maxwell, A. R <ada...@pn...> - 2005-07-06 15:55:02
|
On Jul 6, 2005, at 08:16, Jon Guyer wrote: > > On Jul 6, 2005, at 10:18 AM, J=E9r=F4me Laurens wrote: > > >> What will happen if I duplicate a file, for example by copying it =20 >> on a USB memory key, then copy it on my home computer, then copy =20 >> it back. What is the location pointed to by the alias? It might be =20= >> consistent but not correct. >> This is an example where the path can be correct but the alias can =20= >> be broken. >> On the other hand, changing a file name will break the stored path =20= >> but not the alias. >> > > Aliases can be relative <http://developer.apple.com/samplecode/=20 > resolveRelativeAlias/resolveRelativeAlias.html> Or if you don't grok Pascal (or whatever that sample is :)... <http://developer.apple.com/documentation/MacOSX/Conceptual/=20 BPFileSystem/Concepts/Aliases.html> has some info on relative paths =20 vs. aliases. If you're using Cocoa, BDAlias is useful for working with aliases and =20= paths, especially for serializing aliases: <http://bdistributed.com/=20 Projects/BDAlias/>. My own view is that hard-coded paths in plists and code are evil, =20 whether they are paths to a recent file, Application Support, =20 Preferences, or a temp directory. -- Adam |