Re: isDirectory and real folders
Re: isDirectory and real folders
- Subject: Re: isDirectory and real folders
- From: Charles Srstka <email@hidden>
- Date: Sat, 1 May 2004 13:11:15 -0500
On May 1, 2004, at 8:27 AM, Luca Torella wrote:
Hello, my application should distinguish files from folders. I use the
following method:
BOOL = [NSFileWrapper isDirectory];
The problem is that I'd like to consider every package (like the one
of the apps) likes file and not like folders. How can I do that?
Standard disclaimer: Code written in Mail.app, not tested, yadda yadda
yadda.
BOOL exists;
BOOL isDir;
exists = [[NSFileManager defaultManager] fileExistsAtPath:filePath
isDirectory:&isDir];
if(exists)
{
BOOL isPkg = [[NSWorkspace sharedWorkspace]
isFilePackageAtPath:filePath];
if (isDir && !isPkg)
{
// it's a plain directory
}
else
{
// it's either a regular file or a package
}
}
HTH,
Charles
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.