Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> macOS has a really interesting feature that allows bag of files to appear like a single file

I think this is what you're referring to:

https://en.wikipedia.org/wiki/Package_(macOS)

I used to have problems with running out of file descriptors on MacOS, and I recall that the maximum number was 256. I was wondering if this package abstraction could be used to work around it.

But then I checked `ulimit -a` and it looks like on Big Sur the max is now 2560. Progress!



> I think this is what you're referring to

Almost. I was actually referring to https://en.wikipedia.org/wiki/Bundle_(macOS) which is the same concept.

See also https://developer.apple.com/library/archive/documentation/Mi...


Huh. It looks like "package" is the more general type and "bundle" is a more specific format. Even if "bundle" is what you were thinking of, it looks to me like the high-level description you gave matches "package"!

But I struggle to understand the criteria that a "package" must satisfy to qualify as a "bundle". According to your second link a bundle is "A directory with an internal structure specified by Core Foundation Bundle Services." So there's a finite list of bundle file types, maybe?


> So there's a finite list of bundle file types, maybe?

No, third party software can define bundles too.


LOL. "Wrong!" "Wrong again!" "Still wrong!"

Fine. I tracked down the relevant official documentation:

https://developer.apple.com/library/archive/documentation/Co...

> • A package is any directory that the Finder presents to the user as if it were a single file.

> • A bundle is a directory with a standardized hierarchical structure that holds executable code and the resources used by that code.

[...]

> The Finder considers a directory to be a package if any of the following conditions are true:

> • The directory has a known filename extension: .app, .bundle, .framework, .plugin, .kext, and so on.

> • The directory has an extension that some other application claims represents a package type; see Document Packages.

> • The directory has its package bit set.


Ah, you were right and it was actually packages I was thinking of after all. Thank you and sorry.


Thanks for the validation, and I learned something useful tonight! I'd discovered accidentally how to traverse those pseudo-directories, both in the terminal and the finder. Now I know what's actually going on!


The wikipedia article does not mention the most common example -- .app "files"/bundles.

E.g.:

    zsh% ls Applications/Firefox.app/Contents
    CodeResources   Library         PkgInfo         _CodeSignature
    Info.plist      MacOS           Resources




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: