• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How do you know a file is an Application?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.
References: 
 >How do you know a file is an Application? (From: Jesus De Meyer <email@hidden>)

  • Prev by Date: Re: Newbie question: forcing data format during saveDocumentTo:
  • Next by Date: Re: How do you know a file is an Application?
  • Previous by thread: Re: How do you know a file is an Application?
  • Next by thread: Re: How do you know a file is an Application?
  • Index(es):
    • Date
    • Thread