At 15:12 -0700 23/09/08, [EMAIL PROTECTED] wrote:
>From: Ken Thomases <[EMAIL PROTECTED]>
>References: <[EMAIL PROTECTED]>
>In-Reply-To: <[EMAIL PROTECTED]>
>Date: Tue, 23 Sep 2008 15:40:47 -0500
>Message-ID: <[EMAIL PROTECTED]>
>
>Apple has never officially supported applications creating alias files.  In 
>fact, the documentation often refers to them as "Finder alias files" because, 
>as far as Apple is concerned, only the Finder should ever be creating them.  
>See the section "Working With Finder Alias Files" in the Alias Manager 
>Reference, and notice that there are only functions for examining and reading 
>alias files, not creating them.  For that reason, the supported way to create 
>an alias file is to use Apple Events to ask the Finder to create it for you.

That's news to me... I really can't recall right now where the alias file 
format was officially documented, but in the Classic days it was quite 
acceptable to create them yourself. (They were invented before Apple Events, 
after all ;-) )



>From: chaitanya pandit <[EMAIL PROTECTED]>
>References: <[EMAIL PROTECTED]>
>       <[EMAIL PROTECTED]>
>       <[EMAIL PROTECTED]>
>       <[EMAIL PROTECTED]>
>       <[EMAIL PROTECTED]>
>       <[EMAIL PROTECTED]>
>In-Reply-To: <[EMAIL PROTECTED]>
>Date: Wed, 24 Sep 2008 03:27:59 +0530
>Message-ID: <[EMAIL PROTECTED]>
>
>Here is what i did:
>...
>                       long handleSize = GetHandleSize((Handle)aliasHandle);
>                       int wrote = write(fd, &handleSize, sizeof(long));
>                       wrote = write(fd, *aliasHandle, handleSize);
>                       close(fd);

That's the error. An alias file isn't just an alias handle written out into the 
data fork.

You have to create a resource file (with a resource fork), the file's Finder 
flags should have the kIsAlias bit turned on, and then you save the alias 
Handle as resource ID#0 with type 'alis'. Details in <Resources.h>, if I recall 
correctly.

-- 
Rainer Brockerhoff  <[EMAIL PROTECTED]>
Belo Horizonte, Brazil
"In the affairs of others even fools are wise
 In their own business even sages err."
Weblog: http://www.brockerhoff.net/bb/viewtopic.php
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to