Jerry Krinock wrote:
My app needs a reference to files that may or may not exist (yet).

When the file exists, I prefer to use the Alias because it tracks if the user moves it, etc. But if the file does not exist yet, my +[NSData aliasRecordFromPath:] method (shown below) returns nil.

It is implied but not explicitly stated in the Alias Manager Reference that you cannot have an Alias to a nonexistent file. My main question: Is this true?

No. There's the function NewAliasMinimalFromFullPath, whose documentation says it can be used to create an alias for a file that doesn't exist. However, this function is deprecated, with no replacement, and I think it might expect an HFS-style path.

If you know that the parent directory of the file exists, then you can use FSNewAliasMinimalUnicode, and its documentation does say it will work in this case.
--
  James W. Walker, Innoventive Software LLC
  <http://www.frameforge3d.com/>
_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Reply via email to