3 ms·
> 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.
by rectang 6y ago
> 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) 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!
- quesera 6y agoThe 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
- codetrotter 6y ago> I think this is what you're referring to Almost. I was actually referring to https://en.wikipedia.org/wiki/Bundle_(macOS) https://en.wikipedia.org/wiki/Bundle_(macOS) which is the same concept. See also https://developer.apple.com/library/archive/documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html#//apple_ref/doc/uid/TP40009259-SW1 https://developer.apple.com/library/archive/documentation/Mi...
- rectang 6y agoHuh. 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?
- codetrotter 6y ago> So there's a finite list of bundle file types, maybe? No, third party software can define bundles too.
- rectang 6y agoLOL. "Wrong!" "Wrong again!" "Still wrong!" Fine. I tracked down the relevant official documentation: https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFBundles/AboutBundles/AboutBundles.html 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.
- codetrotter 6y agoAh, you were right and it was actually packages I was thinking of after all. Thank you and sorry.
- rectang 6y agoThanks 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!