Re: Is a unix path a child of a parent
Re: Is a unix path a child of a parent
- Subject: Re: Is a unix path a child of a parent
- From: "Quinn \"The Eskimo!\"" <email@hidden>
- Date: Tue, 12 Mar 2013 09:53:02 +0000
On 12 Mar 2013, at 07:28, tridiak <email@hidden> wrote:
> How do you determine if a unix path childPath has a parent parentPath?
There are many gotchas here. The hardest to reconcile is hard links. It's perfectly feasible to have /D1/F and /D2/F, where D1 and D2 are directories and F is a file. If you start from F there's no way to get both D1 and D2; standard APIs for this (things like FSGetCatalogInfo and F_GETPATH) just return one or the other. You have to decide whether that's OK or not.
Also, keep in mind that, unlike normal UNIX systems, hard links can apply to directories (but only inside Time Machine backups). If you expect your code to work for stuff inside a Time Machine backup (which most apps should) you have to deal with that case as well.
Taking a step back, what decisions are you making based on this info? Depending on what you're really trying to do, there may be a better approach.
Share and Enjoy
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
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