The canonical way is to use LaunchServices (LSInfo.h)
+ (BOOL) isApplicationAtPath:(NSString*)aPath {
LSItemInfoRecord infoRec;
LSCopyItemInfoForURL((CFURLRef)[NSURL fileURLWithPath: aPath],
kLSRequestBasicFlagsOnly, &infoRec);
return infoRec.flags & kLSItemInfoIsApplication;
}
Karl
On Nov 10, 2003, at 8:19 PM, SD wrote:
> Given a path name, this there a way to verify that the path points to
> an application (either Carbon or Cocoa package)?
>
> I know Cocoa packages will end with the .app suffix but Carbon may not.
>
> Thanx, SD.
> _______________________________________________
> MacOSX-dev mailing list
> <MacOSX-dev...>
> http://www.omnigroup.com/mailman/listinfo/macosx-dev
>
>
--
It is by caffeine alone that I set my mind in motion. It is by the
Coca-Cola that the thoughts acquire speed, the lips acquire stains, the
stains become a warning. It is by caffeine alone that I set my mind in
motion.
Homepage:
http://homepage.mac.com/khsu/index.html