Hi List,
Following method returns false, if i pass correct absolute bundle
path. Is there is anything wrong in this method:
- (BOOL) isBundle:(NSString *)inPath {
FSCatalogInfo info; FSRef fileRef; OSErr
err = noErr; Boolean isDirectory;
const char *path = [inPath cString]; err = FSPathMakeRef ((UInt8 *)
path, &fileRef, &isDirectory); if( err != noErr) return NO;
err = FSGetCatalogInfo( &fileRef, kFSCatInfoFinderInfo, &info,
NULL,NULL, NULL ); if( err != noErr ) return NO;
FileInfo* fInfo = (FileInfo*) info.finderInfo;
BOOL result = fInfo->finderFlags & kHasBundle;
NSLog(@"fInfo->finderFlags %x", fInfo->finderFlags);
NSLog(@"kHasBundle %x", kHasBundle);
NSLog(@"Path: %@ \n result %d", inPath, result); return result;
}
Thanks,- Apparao