Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

It seems to me that the Finder does not (on the surface) distinguish between aliases and symbolic links. (In particular, in the Get Info window for a symlink the Finder claims the symlink is an alias.) But is there a way to force symlinks all to be assigned a certain icon (that isn't the standard folder-with-a-little-arrow alias icon)? That is, is the global 'alias' icon file different from the global 'symlink' icon file, or can one instruct the Finder to use a different icon file for symlinks?

I imagine that one could write a script that would create a symlink and assign the created link a certain icon. But I'm hoping to change the icons of all existing symlinks, so I don't have to change all the icons manually.

I'd like to know because I use both (aliases when I'm lazy and just need a quick shortcut, and symlinks when I need something more robust), and it would be nice to be able to see the difference in the icons.

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

There is a cute bash script that converts your aliases into symlinks, which sounds like your best bet honestly. Aliases aren't useful for much really.

share|improve this answer
1  
More apple script alias handling code here : apple.stackexchange.com/questions/2656/… –  Jeff Burdges Dec 1 '11 at 1:25
    
I would dispute that aliases aren't very useful. They have the distinct advantage of letting you freely move or rename the source and/or target files without breaking the link. –  scottishwildcat Dec 31 '11 at 14:53
    
Aliases fail when accessed via ordinary system calls, making them unusable from almost all programming languages, scripting environments, etc., even the command line. Hard links are the only POSIX correct way to provide the functionality you describe. –  Jeff Burdges Jan 1 '12 at 14:41
    
Thanks, Jeff! I'm still hoping for a script that changes (globally) the icons of symlinks, though. –  Zach N Feb 5 '12 at 14:53
add comment

Symlinks are a Unix concept. They are special files that point to other files, so that, in many cases, accessing the symlink (for instance if it points to a shell script) really access the underlying file (running the script).

Aliases are a Mac concept (though OS/2 had something similar, I forget what it was called).

As far as I can tell aliases can be made only from the finder whereas symbolic links can be made from a terminal window. (It is possible to make an alias from the command line but you have to write applescript to do so).

Aliases have one advantage over symbolic links. If the underlying file that the alias points to is moved the alias is automatically updated. Not so with symbolic links; they break (i.e. point to nowhere) if the underlying file is moved.

I've been interested in this question because I'm trying to write a script that will bring up a getinfo window when typed from the command line. So far the best I've been able to do is to copy some scripts that do this from other web sites. The drawback is that, unlike selecting Get Information on a symbolic link from a finder window these scripts show get getinfo window for the underlying file, not for the symbolic link.

It is definitely a side project for me, but if I find the answer I'll post it.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.