Thursday, February 03, 2005

iPhoto aliases are not -- they're relative symlinks

macosxhints - Use symbolic links instead of aliases on the desktop

When you browse an iPhoto Library file tree, you see that albums are instantiated as folders. Each folder contains what appears to be an alias.

Only they're not.

If you copy an iPhoto album, the aliases reference images in the tree of the copied album, they don't reference the original files.

A true OS X alias would reference the original File ID, not the ID of the copied file. (This worked better in OS 9, changing a file extension in OS X will break an alias even if the File ID doesn't change, this Mac OS X hints page has a good discussion.)

What appear to be iPhoto aliases are in fact relative symlinks. I copied one to the desktop and noticed it lost its icon. Then when running ls -l from the terminal one finds:

lrwxr-xr-x 1 jgf staff 29 3 Feb 18:23 IMG_2523.JPG -> ../../2003/07/13/IMG_2523.JPG

I'm not a unix guy, but I think lrwxr is the signature of a typical symlink. That's why one can copy an iPhoto Library and not have the whole thing fall apart.

No comments: