Re: Filesystem path that works even after a dir is moved?
Re: Filesystem path that works even after a dir is moved?
- Subject: Re: Filesystem path that works even after a dir is moved?
- From: Dominic Giampaolo <email@hidden>
- Date: Mon, 02 Nov 2015 15:39:44 -0500
> Is there any way to create an alternative path to a directory, that will remain valid even if the directory is moved?
>
If you mean a posix level path, there is no way that I'm aware of.
> Otherwise, the only other way I can think of is to create a hard-link to the directory at some temporary location and use
>
You can not create hard-links to directories for this purpose. Hard-links to directories have a ton of restrictions that are necessary to prevent cycles in the namespace and thus are really only useful for TimeMachine (which is what they were invented for).
> (There’s also the option of watching FSEvents to notice when the directory has been moved. There are obvious race conditions associated with this, though; I’m not going there.)
>
That could work. Or you could create a CF/NSURL Bookmark to locate the document when the user tries to open it and then patch up any paths it stores before you ask your library of db code to open the db.
--dominic
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden