Re: Quick way to find is a path is contained in another path?
Re: Quick way to find is a path is contained in another path?
- Subject: Re: Quick way to find is a path is contained in another path?
- From: Graham Cox <email@hidden>
- Date: Sat, 19 Mar 2011 14:31:34 +1100
On 19/03/2011, at 12:15 PM, koko wrote:
> BOOL isDirectory;
> BOOL exists = [[NSFileManager defaultManager] fileExistsAtPath:@"/Library/Users/laurent/Library" isDirectory:&isDirectory]
> if(exists && isDirectory)
> NSLog(@"EUREKA I have found it!");
>
>
This does not solve the OP's problem.
Yes, it tells you that a file exists at that path, it does not tell you whether it's a child (or parent) of some other path, which may or may not refer to an actual file or directory that exists at the moment. The string comparison approach suggested is what I've used, and works fine.
--Graham
_______________________________________________
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