Best way to determine if a path is a directory?
Best way to determine if a path is a directory?
- Subject: Best way to determine if a path is a directory?
- From: Martin van-Eerde <email@hidden>
- Date: Wed, 31 Jan 2007 19:59:03 +0000
Hello list,
Thanks for the help I have had so far, what I want to do is determine
if a given file path relates to a directory or not and have the
following code:
+(BOOL) isFileADirectory:(NSString *)path
{
NSFileManager *fm = [NSFileManager defaultManager];
BOOL isDir;
if ([fm fileExistsAtPath:path isDirectory:&isDir] && isDir) {
isDir = ![[NSWorkspace sharedWorkspace] isFilePackageAtPath:path];
}
return isDir;
}
Is there a better way, it just seems strange that I need to do a
second call to remove packages/applications...
Thanks Martin
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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