Re: Mac resource forks from Lispworks
Perhaps I'm misunderstanding, but aren't all the application icons located in the Contents/Resources folder of the .app "file"? The filename of the icns file will be located in Contents/Info.plist under:
You're right: you're misunderstanding.
You're quite right about the accessibility of app icons, but that's not what I'm talking about. What I'm talking about is this:
Notice the custom icons on the Finder's view of the Adobe folders.
The icon resources are stored here:
See the file named "Icon"? In fact, it's actually named "Icon<carriage-return>", and it's an empty file:
esthannon:~ mikel$ cd /Applications/Adobe\ InDesign\ CS5.5
esthannon:Adobe InDesign CS5.5 mikel$ ls -l Icon^M
-rw-r--r--@ 1 root admin 0 Feb 24 2013 Icon?
The file that ls examines is empty, but there is also a resource fork that isn't empty:
esthannon:Adobe InDesign CS5.5 mikel$ ls -l Icon^M/..namedfork/rsrc
-rw-r--r-- 1 root admin 133034 Feb 24 2013 Icon?/..namedfork/rsrc
That resource fork is where the custom icon shown in the Finder for InDesign resides. I need to be able to display that custom icon in the same way that the Finder does.
I consider this question answered. I already knew how to do it from Cocoa code; I was looking for a way to tell Lispworks to read the data from the resource fork in order to dodge writing Cocoa code, but I buy Camille's argument that it's better to just go ahead and use Cocoa. Apple could change how these data are stored at any point in the future, and it's marginally less likely that such changes will break my code if I use the native Cocoa idiom for reading them.