• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Quick way to find is a path is contained in another path?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Quick way to find is a path is contained in another path? (From: Laurent Daudelin <email@hidden>)
 >Re: Quick way to find is a path is contained in another path? (From: Mike Abdullah <email@hidden>)
 >Re: Quick way to find is a path is contained in another path? (From: Laurent Daudelin <email@hidden>)
 >Re: Quick way to find is a path is contained in another path? (From: koko <email@hidden>)

  • Prev by Date: Re: Quick way to find is a path is contained in another path?
  • Next by Date: Icon not bouncing in Dock when App started
  • Previous by thread: Re: Quick way to find is a path is contained in another path?
  • Next by thread: Re: Quick way to find is a path is contained in another path?
  • Index(es):
    • Date
    • Thread