Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

alias is created instead of symlink

Hello there,


Does anyone know why OSX 10.9.2 keeps creating an alias when I try to create a symlink?

I use the command ln -s for a service created in automator as shown on the screen capture.

User uploaded file


When I test the result by changing the location of the target file, the "link" still works, showing that what is created is an alias and not a symlink (for which the link would be broken when moving the target file).


The same thing happens if I try to use the terminal directly.


Do you have any idea how can I solve this ?


Thanks !


R.

Posted on Nov 24, 2015 5:30 AM

Reply
2 replies

Nov 24, 2015 10:45 AM in response to ronfya

Are you sure. The 'ln' command does not know about aliases. It only knows about hardlinks and symlinks.


If you do an ls -l a symlink should have a size approx the length of the link. An alias will have anywhere from a 100K to over a megabyte depending on what is stored in the alias, and if it has a custom icon.


ls -l

lrwxr-xr-x 1 me staff 5 May 11 2015 12345.symlink -> 12345

-rw-r--r--+ 1 me staff 171312 Apr 29 2015 12345_alias


Notice that the symlink is small (5 bytes) and the alias is large (171K bytes).


The symlink stars wtih 'l' (el) and the alias starts with '-' as in it is a regular file, not s special file system metadata file.


If you 'ln' command is creating large files then it is not the original 'ln' command, as shipped with OS X Mavericks.

Nov 24, 2015 11:21 AM in response to ronfya

You are working in two different worlds. I recreated your Service here, and with a Finder window open on the Desktop, I selected a file, and applied your service. The result in the Finder was an alias (curved arrow, and get info confirmation), while in the UNIX Terminal, the ls command confirmed that it was a symbolic link.


Tested: OS X 10.11.1


The following code will display the POSIX path of that selected Finder object as it is passed into the script.

osascript <<EOF - "$@"

on run argv

display dialog (item 1 of argv) as text

end run

EOF




for f in "$@"

do

ln -s "$@" "$@.link"

done

alias is created instead of symlink

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.