In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Paul McCann) wrote:
> http://use.perl.org/~pudge/journal/10437 Thanks Paul. I knew I had this code somewhere, but couldn't find it. :-) Here's a slightly cleaned-up version. #!/usr/bin/perl use warnings; use strict; use MacPerl qw(GetFileInfo); use Mac::AppleEvents qw(typeAlias); use Mac::Errors; use Mac::Files; use Mac::Resources; my $target = '/Users/pudge/Desktop/foo'; my $alias = '/Users/pudge/Desktop/foo alias'; # get target's creator, type, and alias my($creator, $type) = GetFileInfo($target); my $alis = NewAlias($target) or die $Mac::Errors::MacError; # make resource file, open it, add the resource, and close it FSpCreateResFile($alias, $creator, $type, 0) or die $Mac::Errors::MacError; my $res = FSpOpenResFile($alias, 0) or die $Mac::Errors::MacError; AddResource($alis, typeAlias, 0, '') or die $Mac::Errors::MacError; CloseResFile($res); # set "alias" attribute my $finfo = FSpGetFInfo($alias) or die $Mac::Errors::MacError; $finfo->fdFlags( $finfo->fdFlags | kIsAlias ); FSpSetFInfo($alias, $finfo) or die $Mac::Errors::MacError; -- Chris Nandor [EMAIL PROTECTED] http://pudge.net/ Open Source Technology Group [EMAIL PROTECTED] http://ostg.com/