PDA

View Full Version : Symbolic Links and keeping sidebar icons




benm7
Jul 27, 2012, 04:33 AM
Hi guys,

Firstly apologies becuase I know this has been discussed to death, but I simply cannot find the solution!= after an extensive search!

I have two user accounts that I want to share the following folders and files between (I want my wife to have her own log in so she can post to facebook direct etc in the future and get her own email, but we have no need to maintain separate files in general), and have them easily accessible to both users:
- Documents
- Pictures
- Movies
- Music
- Downloads

To do this , I have created a separate partition on my SSD that I will use for files only. This is called 'Shared Documents'.

I have tried using symlinks to redirect to the same named folders on 'Shared Documents' and this works ok. I have used the following commands for example on the Downloads folder from the current user Home folder:

sudo rm -rf ~/Downloads
ln -s /Volumes/Shared*Documents/Downloads Downloads

The problem I have is that I want to maintain the finder sidebar links and the same icons as the default user folders uses. When i run the RM command, as well as removing the current folder in the user home it also removes the sidebar link and icon.

Is there any way to have the sidebar link direct to the new folder WITHOUT losing the sidebar link and icon in the first place?

Any help is greatly appreciated!



ConCat
Jul 27, 2012, 04:37 AM
Just create the symlink and move it to the sidebar. Does this solve your problem?

haravikk
Jul 27, 2012, 05:30 AM
As ConCat says you can just re-add the icon to the sidebar manually, the problem is that you will lose the icon, even if you apply it to the symlink in Get Info.

Also, a lot of OS X's UI doesn't handle symbolic-links as invisibly as you might like, which makes it less seamless than it could be; I've been using a split files setup with most of my home folder on a different drive but linked using symbolic links.


An alternative scheme would be to place the shared folder on the same volume (don't use a partition) as that way you can use hard-links (same command but without the -s flag), as these functions far more invisibly. You'd probably still need to restore the sidebar entries, but you'd get the same icons and such, and it would be better supported by the OS.

The side-effect of this however is that you will need to prevent Time Machine from backing up three copies of the same data, but you can do this by excluding the hard-linked folders from your user directories, but let it backup the shared folder normally.

You need to be quite careful with hard-linking, but it's smoother overall when you're in a situation where you can use (same volume).

ConCat
Jul 27, 2012, 05:53 AM
OS X doesn't natively let you hard-link folders from the command-line, you have to compile your own code to do that. As you said, it is quite dangerous.

benm7
Jul 27, 2012, 05:57 AM
Thanks guys, looks like there is no simple solution then without knowing things inside out, which I don't.

I think i might just accept that I won't have the sidebar icons the same and use the current symlinks I have...