0

System in OS X 10.11.4 El Capitan

$ cd $HOME
$ ls .
> Dropbox
> BTsync

Code which creates unsuccessful symlink

ln -s BTsync/ Dropbox/

Code which creates working symlink

ln -s /Users/masi/BTSync/ /Users/masi/Dropbox/

Evidence in size difference with files

$ cd $HOME
$ ln -s $HOME/BTsync/wfdb.zip $HOME/Dropbox/
$ ln -s BTsync/wfdb.zip Dropbox/wasi.zip
$ ls -la $HOME/Dropbox/
lrwxr-xr-x   1 masi  staff    41 May 17 22:45 wfdb.zip -> BTsync/wfdb.zip
lrwxr-xr-x   1 masi  staff    46 May 17 22:45 wasi.zip -> /Users/masi/Dropbox/wfdb.zip

Evidence with directories

$ ln -s /Users/masi/BTsync/cam\ local/ /Users/masi/Dropbox/
$ ln -s BTsync/cam\ local/ Dropbox/camLocal2
$ ls -la $HOME/Dropbox
lrwxr-xr-x   1 masi  staff    37 May 17 22:52 camlocal -> /Users/masi/BTsync/cam local/
lrwxr-xr-x   1 masi  staff    25 May 17 22:53 camLocal2 -> BTsync/cam local/

and visually same in Finder

enter image description here

which shows that the two commands are not the same in El Capitan. Using absolute PATH only works.

Evidence with Relative PATH

$ cd $HOME
$ ln -s ./BitTorrentSync/cam\ local/ ./Dropbox/camlocal3
$ ls -la Dropbox/ 
lrwxr-xr-x   1 masi  staff    27 May 17 22:58 camlocal3 -> ./BTsync/cam local/

and a new screenshot

enter image description here


Why OSX Symlink cannot Relative PATHs?

1

This isn't about relative paths. Relative paths work fine.

If what you're trying to do here is create a symlink from Dropbox to BTsync, the problem is that Dropbox already exists. This means the symlink is created inside the Dropbox folder, named BTSync. Delete Dropbox and try again.

If you really meant to create a symlink inside the Dropbox folder, then both these commands work identically.

  • @Masi You want BTsync to be a symlink to Dropbox? Then you've got your arguments the wrong way round. Check the link in my answer for the basics of symlinking. – grg May 17 '16 at 19:41
  • @Masi Please edit your question back to avoid confusion. I tried both commands in 10.11.4 and they work identically. Are you getting an error? What doesn't work? – grg May 17 '16 at 19:42
  • Please, see the body for the proofs. – Léo Léopold Hertz 준영 May 17 '16 at 19:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .