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

Re: [MacPerl] Aliases



>Can I (how can I :-) make and read aliases under MacPerl.
>
>Actually, I think I know how to read them (with stat) but
>can I easily create them?

Yes, with <symlink> -- it works beautifully on the Mac. Just do something
like <symlink("MyFile", "MF alias")> and an alias icon will pop up with "MF
alias" in italics. In the general case you need full path names of course.

(-l _) will return 1 after a lstat("MF alias"), since lstat 'stats' the
symbolic link rather than the file the link points to: (-e _) will return 1
after stat("MF alias"), since 'stat' looks at the file itself.

Hence if you wanted to examine a list of objects to find active links you
would first 'lstat' them all to see if any were links (i.e. aliases) using
-l as the test, and then 'stat' any links to see if they were active using
-e as the test.

Hope this helps,

Alan