Re: Finder displays document bundles as ordinary folders, what to do?
Re: Finder displays document bundles as ordinary folders, what to do?
- Subject: Re: Finder displays document bundles as ordinary folders, what to do?
- From: Raphael Sebbe <email@hidden>
- Date: Wed, 9 May 2001 12:41:57 +0200
Hi,
I discussed this with M. Ferris on the PB mailing list. At the end of
this mail is what you are looking for.
Raphael Sebbe
To be sure Finder will treat folders with your extension as packages,
make sure your document type dictionaries in your Info.plist have the
key LSIsPackageType whose value is boolean YES.
Finder no longer treats a folder with a known extension as a package
unless the app that claims the extension has that key. I think this
came about because apparently some folks had folders with names like
"Foo.c" that were then turning opaque in Finder because of the ".c".
The new key helps narrow the cases where this might happen...
This is completely a Finder/Launch Services thing. It has nothing to
do with how, in your Cocoa app, you are reading and writing your
packages. NSFileWrapper is a cool class for dealing with file
packages, but using it or not has no effect on this sort of thing.
In addition to the LSIsPackageType key you might also want to consider
writing a Content/PkgInfo file in your wrapper. Finder also uses this
to identify packages. Having this file in addition to the Info.plist
key in your app will mean that even people who do not have your app
will still see your documents as atomic (not with the right icon, but
at least not as folders). The PkgInfo file is an 8-byte file where the
first four bytes are the document type and the last four are the app's
creator code.
Mike Ferris
+
As a side note, it is not LSIsPackageType, but LSTypeIsPackage instead
(as found in the InfoPList release note). Everything is working great
now, thanks.
Raphael