Re: Creating alias programatically

2008-09-24 Thread Charles Srstka
On Sep 24, 2008, at 9:19 AM, Michael Ash wrote: On Wed, Sep 24, 2008 at 1:43 AM, Charles Srstka <[EMAIL PROTECTED]> wrote: [source appendFormat:@"set theAlias to make alias at POSIX file \"[EMAIL PROTECTED]" to POSIX file \"[EMAIL PROTECTED]"\n", NSTemporaryDirectory(), originalPath]; Ple

Re: Creating alias programatically

2008-09-24 Thread Rainer Brockerhoff
At 18:15 -0500 23/09/08, Ken Thomases wrote: >On Sep 23, 2008, at 5:54 PM, Rainer Brockerhoff wrote: >>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... > >From

Re: Creating alias programatically

2008-09-24 Thread Michael Ash
On Wed, Sep 24, 2008 at 1:43 AM, Charles Srstka <[EMAIL PROTECTED]> wrote: >[source appendFormat:@"set theAlias to make alias at POSIX file \"[EMAIL > PROTECTED]" to > POSIX file \"[EMAIL PROTECTED]"\n", NSTemporaryDirectory(), originalPath]; Please never do anything like this. This will fail

Re: Creating alias programatically

2008-09-23 Thread Charles Srstka
On Sep 23, 2008, at 5:54 PM, Rainer Brockerhoff wrote: (They were invented before Apple Events, after all ;-) ) This is actually not correct - alias files and Apple Events were both introduced simultaneously in System 7.0. Charles ___ Cocoa-dev

Re: Creating alias programatically

2008-09-23 Thread Charles Srstka
On Sep 24, 2008, at 12:14 AM, chaitanya pandit wrote: On 24-Sep-08, at 5:10 AM, Charles Srstka wrote: On Sep 23, 2008, at 5:02 PM, Nick Zitzmann wrote: On Sep 23, 2008, at 3:57 PM, chaitanya pandit wrote: It created an executable file with name foobar alias on desktop but when i try to o

Re: Creating alias programatically

2008-09-23 Thread Charles Srstka
On Sep 23, 2008, at 5:02 PM, Nick Zitzmann wrote: On Sep 23, 2008, at 3:57 PM, chaitanya pandit wrote: It created an executable file with name foobar alias on desktop but when i try to open it it says "chaitanya-pandits-macbook:~ chaitanya$ /Users/chaitanya/Desktop/ foobar\ alias ; exit; -ba

Re: Creating alias programatically

2008-09-23 Thread Sean McBride
Chaitanya, If you're working with aliases and Cocoa, take a look at the free NDAlias classes. There are even methods to create alias files. -- Sean McBride, B. Eng [EMAIL PROTECTED] Rogue Research

Re: Creating alias programatically

2008-09-23 Thread Ken Thomases
On Sep 23, 2008, at 5:54 PM, Rainer Brockerhoff wrote: At 15:12 -0700 23/09/08, [EMAIL PROTECTED] wrote: From: Ken Thomases <[EMAIL PROTECTED]> Apple has never officially supported applications creating alias files. In fact, the documentation often refers to them as "Finder alias files" b

Re: Creating alias programatically

2008-09-23 Thread Rainer Brockerhoff
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 fi

Re: Creating alias programatically

2008-09-23 Thread chaitanya pandit
On 24-Sep-08, at 3:32 AM, Nick Zitzmann wrote: On Sep 23, 2008, at 3:57 PM, chaitanya pandit wrote: It created an executable file with name foobar alias on desktop but when i try to open it it says "chaitanya-pandits-macbook:~ chaitanya$ /Users/chaitanya/Desktop/ foobar\ alias ; exit; -bas

Re: Creating alias programatically

2008-09-23 Thread Nick Zitzmann
On Sep 23, 2008, at 3:57 PM, chaitanya pandit wrote: It created an executable file with name foobar alias on desktop but when i try to open it it says "chaitanya-pandits-macbook:~ chaitanya$ /Users/chaitanya/Desktop/ foobar\ alias ; exit; -bash: /Users/chaitanya/Desktop/foobar alias: cannot e

Re: Creating alias programatically

2008-09-23 Thread chaitanya pandit
On 24-Sep-08, at 2:22 AM, Nick Zitzmann wrote: On Sep 23, 2008, at 2:48 PM, chaitanya pandit wrote: I tried using: OSErr FSNewAliasFromPath ( const char *fromFilePath, const char *targetPath, OptionBits flags, AliasHandle *inAlias, Boolean *isDirectory ); But i don't quite get how shoul

Re: Creating alias programatically

2008-09-23 Thread Ken Thomases
On Sep 23, 2008, at 4:04 PM, chaitanya pandit wrote: Suppose the target file to which the symbolic link is pointing to is moved, is there any way one can determine where it was moved or deleted? Assuming the file was moved even when the app was not running? Generally, symbolic links don't

Re: Creating alias programatically

2008-09-23 Thread chaitanya pandit
Thanks for the input Ken, Suppose the target file to which the symbolic link is pointing to is moved, is there any way one can determine where it was moved or deleted? Assuming the file was moved even when the app was not running? On 24-Sep-08, at 2:10 AM, Ken Thomases wrote: On Sep 23, 20

Re: Creating alias programatically

2008-09-23 Thread Nick Zitzmann
On Sep 23, 2008, at 2:48 PM, chaitanya pandit wrote: I tried using: OSErr FSNewAliasFromPath ( const char *fromFilePath, const char *targetPath, OptionBits flags, AliasHandle *inAlias, Boolean *isDirectory ); But i don't quite get how should i use the fromFilePath parameter, say i want to

Re: Creating alias programatically

2008-09-23 Thread chaitanya pandit
I tried using: OSErr FSNewAliasFromPath ( const char *fromFilePath, const char *targetPath, OptionBits flags, AliasHandle *inAlias, Boolean *isDirectory ); But i don't quite get how should i use the fromFilePath parameter, say i want to create an alias for "Users/me/Documents/foo" at "Users/

Re: Creating alias programatically

2008-09-23 Thread Ken Thomases
On Sep 23, 2008, at 2:13 PM, chaitanya pandit wrote: I've been struggling with for quite a while now, what i want to achieve is create an alias of a folder at some location. You may be being tripped up by terminology. An "alias" is an opaque data structure in memory. An "alias file" is a

Re: Creating alias programatically

2008-09-23 Thread Nick Zitzmann
On Sep 23, 2008, at 2:32 PM, chaitanya pandit wrote: I tried using symbolic link, but if the target file is moved, the link fails, just curious to know of any reasons i should avoid creating aliases? What i need is the link should work even if the target is moved. Because aliases are on

Re: Creating alias programatically

2008-09-23 Thread chaitanya pandit
On 24-Sep-08, at 1:47 AM, Nick Zitzmann wrote: On Sep 23, 2008, at 1:13 PM, chaitanya pandit wrote: I've been struggling with for quite a while now, what i want to achieve is create an alias of a folder at some location. The alias would also be a folder like we have after creating an alia

Re: Creating alias programatically

2008-09-23 Thread Nick Zitzmann
On Sep 23, 2008, at 1:13 PM, chaitanya pandit wrote: I've been struggling with for quite a while now, what i want to achieve is create an alias of a folder at some location. The alias would also be a folder like we have after creating an alias in the finder. say i have a folder "foo" in "

Creating alias programatically

2008-09-23 Thread chaitanya pandit
Hi, I've been struggling with for quite a while now, what i want to achieve is create an alias of a folder at some location. The alias would also be a folder like we have after creating an alias in the finder. say i have a folder "foo" in "/Users/me/Documents/foo" and i want to programati