Re: How do you know a file is an Application?
Re: How do you know a file is an Application?
- Subject: Re: How do you know a file is an Application?
- From: "M. Uli Kusterer" <email@hidden>
- Date: Thu, 11 Sep 2003 01:43:49 +0200
At 0:56 Uhr +0200 11.09.2003, Jesus De Meyer wrote:
I used to check for the .app suffix, but obviously this would not
work if the extension was hidden
Extension hiding only changes the _Display name_ of a file. The
actual file name still maintains the extension.
or not written at all.
AFAIK, bundled applications are not supposed to have no extension at
all, so this is no case you'd necessarily have to worry about.
Is there any way to know that a file is of kind "Application"?
However, if you also want to detect older bundles (and bundled
Classic applications), you may want to check any folders you think
may be applications for a "PkgInfo" file containing "APPL" as the
file type, which would indicate that you're really dealing with an
application. They also should have the "package" bit set in their
file information.
If you also want to detect un-bundled CFM applications (which may be
Classic or Carbon applications), you'll have to check their file type
against being 'APPL' as well. (I think someone mentioned
NSFileManager calls this the HFSType. If that isn't the file type
code, you could also resort to certain Carbon APIs like
FSpGetFInfo(), or FSCatalogInfo()).
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
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.