[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

metadata query - help needed



On Mar 4, 2004, at 5:05 PM, Jens Ropers wrote:

>> resource fork with:
>>
>> 	cat file/rsrc

This syntax is deprecated, you want file/..namedfork/rsrc.

>> All on HFS(+). That's a lot *sigh*

But not enough...

> You're right: It's wrong. It's SO WRONG to store the file-specific 
> "Open-with information" in a resource fork. ;-)
> Sadly, you're also wrong, because that is exactly what Apple does.

Resources were a great innovation in 1983, but they haven't evolved 
much since then.  The ability to attach arbitrary metadata to files is 
immensely useful; it just happens that resources are the only mechanism 
currently supported on the Mac.  Windows has some equivalent though 
underused mechanisms, but will evolve considerably if they ever get 
WinFS out the door; Unix has nothing.  I fully expect something more 
along the line of BeFS attributes to be added to Mac OS X at some later 
date.

>>> [Hello? Apple? We thought the use of resforks was being 
>>> discouraged?])
>>
>> They are.
>
> They're not. :)
> See above.

Discouraged when there is another mechanism to use instead; there is as 
yet no replacement for resource forks in storage of per-file metadata 
which should be kept with the file as it's copied, moved, etc. from the 
UI.

> If you still doubt Nicholas and me (perhaps because -- just like 
> myself, you might not be familiar with the "launch" and "DeRez" 
> utilities he mentions), again, if you still don't believe us, here's 
> an easy-peasy way to prove we're right:

You can download launch from <http://web.sabi.net/nriley/software/>, or 
use 'apt-get install launch' with Fink; DeRez should be in 
/Developer/Tools if you have the developer tools installed (it was 
ported from the MPW tool of the same name; in fact the man page still 
contains some references left over from MPW such as the use of 
Mac-style pathnames).

>>> I have then test-installed my package (using Admin authorization, 
>>> which I made the Installer ask for) and found my file in the right 
>>> place, with the right permissions and root:admin as the owner. 
>>> However, I found the file to lack the ability to double-click on it 
>>> to open it in Terminal.
>>
>> In addition to the above three guesses, Finder tries to launch 
>> executables in Terminal.app.
>
> Bleep!
> Wrooong again.

This is true in 10.3 and later for anything with its executable bit set 
which is actually a Mach-O binary; additionally, if the binary links to 
libX11, then it'll open in X11 instead of Terminal.  It is actually 
LaunchServices that manages this, not the Finder itself; it (like my 
'launch' tool, and Apple's 'open' tool among others) is a client of 
LaunchServices.  The per-file binding is set using a private 
LaunchServices SPI.  Rainer Brockerhoff's XRay has the best user 
interface for editing this information I've seen.

> If your Mac is behaving like mine (and I fairly recently installed 
> Panther from scratch), you'll see this:
>
> <Picture 1.pdf>

Actually, for me the script opened in BBEdit.

> Actually, if you've viewed that file in Finder already at this point, 
> then you may have to restart Finder to see that the icon has changed:
> Otherwise Finder doesn't grok that the file has changed and thus 
> doesn't display to you the new icon until you pimp-slap it.

Yup, yet another Finder bug.  Hooray.

> Obviously, knowing now that it's a choice between a rock and a hard 
> place -- like, do you prefer AppleStyle-Kludge(R) or 
> MicrosoftStyle-Kludge(R) -- I might as well go for the .command file 
> extension since it would eliminate my greater problem.
> <em><b><scream>BUT I'D STILL LIKE TO KNOW</scream></b></em> why the 
> feckin thing wasn't playing ball with my file-specific Open-With info.
> As Gertrude Stein would have it: A resfork is a resfork is a resfork!
> Uh, or something.
> I'll start an insurrection over this issue as soon as I finish these 
> donuts.

:-)

> In fairness: Nobody in their right mind would suspect things to work 
> like this.

Yes indeed.  Application binding on OS X is a black art, far too 
confusing for users and even most programmers.  Read some of John 
Siracusa's OS X reviews on ArsTechnica to see this better described 
than I can do.