• 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: generating bundles without an extension?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: generating bundles without an extension?


  • Subject: Re: generating bundles without an extension?
  • From: Rua Haszard Morris <email@hidden>
  • Date: Tue, 20 Feb 2007 15:31:46 +1300

I found the documentation!

http://developer.apple.com/documentation/CoreFoundation/Conceptual/ CFBundles/Concepts/DocumentBundles.html

"Document packages should always have an extension to identify them— even though that extension may be hidden by the user. The extension allows the Finder to identify your document directory and treat it as a package. You should never associate a document package with a MIME type or 4-byte OS type."

(don't worry, I was looking for something else!!)

On Feb 15, 2007, at 10:37 AM, Laurence Harris wrote:


On Feb 14, 2007, at 2:47 PM, Rua Haszard Morris wrote:

Cheers both for your comments, lending weight to my understanding of the situation. We're going to have an extension of some sort... basically because of the "swimming upstream" issue (as opposed to any clear info in the documentation).

Yeah, it's not the kind of thing that's worth spending time to avoid IMO. Not even half as much as you've already spent. ;-)


only nitpicking remains...

but there seem to be some problems related to this:
1. The finder starts showing the bundle as a folder if no extension is used (doesn't seem to matter if the extension is something random).
Packages/bundles are folders with names whose extensions are registered with Launch Services as belonging to a package. Look at the plist of an application that supports some kind of package document such as TextEdit (.rtfd documents are packages).
LSTypeIsPackage is documented as describing whether the app is packaged, http://developer.apple.com/documentation/Carbon/ Conceptual/LaunchServicesConcepts/.
I've just tried setting it to true for the appropriate OSType in the launch services bit of our plist, to no avail.

You'll need to use an extension you define for that to work.

Will I? Why? Where's this documented?

You need to let this go. Lots of stuff isn't documented or isn't fully documented. That doesn't make it less true. Welcome to Mac OS X. :-)


The launch services documentation doesn't say anything about LSTypeIsPackage applying only to document types with an extension. And you can define a document type based on OSType only.

The structure of a package is entirely up to the entity that defines it. There is no requirement for any particular structure, which is obvious if you start poking around in some. Most of them have no Contents > PkgInfo file in them. Besides, you tried it and it didn't work, right? Time to move on and define yourself an extension. None of your users is going to give it a second thought. In fact, they may well see it as evidence that you've done work to make your product Mac OS X savvy.


It's not stated that OSTypes are only supported for legacy reasons, or that they only apply for non-packaged (file) files.

Do yourself a favor and stop struggling with these issues. The guidelines say you should assign file types to your documents and yet virtually no Cocoa application does it -- not even Apple's. I filed a bug related to file types once and devbugs sent me an e- mail asking *me* where the issue was documented. Apple's a big company. Lots of engineers and two separate engineering camps (Carbon and Cocoa) for application development. I get the impression that a lot of people there these days that have no experience developing for what we old-Mac timers think of as the Mac.


I didn't write the docs. I'm just telling you my understanding. You can kick against the pricks if you want, but I don't see any point in even worrying about this.

And this has nothing to do with the finder anyway right? Or, doesn't the finder implement part of launch services?

For example, is there somewhere that documents the fact that a bundle _must_ have an extension in order to be displayed correctly in the finder?
Mac OS X is extension-oriented. Not using an extension would be nonstandard and could confuse some users. FWIW, you can set the bit to hide the extension.
Yet Launch Services still supports OSTypes. I have nothing against extensions, and have not seen any documentation encouraging me not to use OSType in isolation for this purpose.
Understood, but that isn't the same as saying that you won't encounter any issues if you don't use an extension. You may and you may not, but I doubt Apple is investing a lot of resources to ensure that bundles without extensions work without issues.
Yep, exactly, you're right.. like the finder may not do the right thing..

Depends on the definition of "the right thing."

Interestingly the CFBundle apis and our plugin loading/ management code works correctly even when the finder doesn't show the plugin as a bundle.
That's a different system.
It is related though?! The "what is a bundle" rules are consistent, right?
Yes, but you're talking about two distinct technologies: Launch Services and CFBundle, and they can use different rules even though within each technology the rules are consistent.

I guess 3 technologies including the finder.

I think the Finder relies on Launch Services. The Finder doesn't implement any of its own technology regarding all this as far as I know.


Larry


_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >generating bundles without an extension? (From: Rua Haszard Morris <email@hidden>)
 >Re: generating bundles without an extension? (From: Rua Haszard Morris <email@hidden>)
 >Re: generating bundles without an extension? (From: Laurence Harris <email@hidden>)
 >Re: generating bundles without an extension? (From: Laurence Harris <email@hidden>)

  • Prev by Date: Re: What are your top desired improvements in Xcode ?
  • Next by Date: Desired Feature: Language plugins & documentation
  • Previous by thread: Re: generating bundles without an extension?
  • Next by thread: (no subject)
  • Index(es):
    • Date
    • Thread