Re: .webloc files and Safari (newbie)
Re: .webloc files and Safari (newbie)
- Subject: Re: .webloc files and Safari (newbie)
- From: Jérome Foucher <email@hidden>
- Date: Mon, 8 Dec 2003 15:07:36 +0100
On 8 dic. 03, at 14:26, Gregory Weston wrote:
On Dec 8, 2003, at 1:00, email@hidden wrote:
On Sunday, December 7, 2003 at 11:20 PM, jay wrote:
Working on a simple droplet as an excersize and I want it to be able
to
accept drags from Safari. I assumed that the .webloc files you get
when
you drag a url from Safari to the Finder would contain a string of
the
url. But they're 0 byte files. How exactly do these work?
Are you looking in the resource fork or the data fork? I think Webloc
files store there info in the resource fork.
No, the contents are in the data fork (as would make sense, given that
Apple is to all appearances trying to deprecate the resource fork).
They're also much more than just the URL, though. I just grabbed one
and the first 256 bytes are almost all zeroes. Then there's 56 more
bytes of mostly inobvious information. Then the URL, a couple extra
bytes, the URL again and several more mostly-unreadable bytes. You
know what it looks like? An alias record, IIRC.
No sorry, it's not an alias record
It's a flattened resource fork (the resource fork is just dumped into
the data fork). Just open the file using FSOpenResourceFile to access
it as a resource fork.
If I drag an URL from Safari to my desktop, I can see three ressources
inside :
One "TEXT" which is the URL as a C string
One "url " which is also the URL as a C string
One "drag" which is a structure describing which ressources are
present in the fork.
If you're familiar with Mac OS 9's URL clippings, it's the exact same
format, except it's stored in the data fork instead of the resource
fork.
You cannot access the content using Cocoa. You need Carbon to deal with
ressources.
Hope this helps
Jirome
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.