Re: Referring to file by Alias ^or^ path
Re: Referring to file by Alias ^or^ path
- Subject: Re: Referring to file by Alias ^or^ path
- From: James Walker <email@hidden>
- Date: Mon, 01 Jun 2009 17:12:47 -0700
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 (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