I have named my secondary SSD with a name with a space in it - "My SSD", and have been using it for many years with multimedia applications without any problem. Part of my media library with thousands of files is stored on "My SSD" and is indexed by these apps.

However, since I started learning programming, I have encountered problems with multiple command line tools that I use which are not escaping the spaces in paths correctly (should be /Volumes/My\ SSD/Projects instead of /Volumes/My with another argument SSD/Projects).

Setting up a symbolic link doesn't solve this problem, because these applications still resolve the true path of the directory most of the time.

I have considered setting up a hardlink on a drive without a space in its name - "NoWhiteSpaceDrive", but there doesn't seem to be a tool available to do that.

Simply changing "My SSD" to "MySSD" is not a good solution for me because I would need to rescan the huge media library which will take hours to accomplish. Many other aspects and apps on my system are also tied with "My SSD", which may cause problems and I have to adjust them one by one...

Is there a way to set up a cross device hardlink or something similar?

  • 1
    It might be easier to solve this on the tool side. Which tools have problems and how do you call them from the command line? – nohillside Oct 12 '18 at 16:11
  • Besides that, you might get away with renaming the disk and then adding a symlink for "My SSD" :-) – nohillside Oct 12 '18 at 16:12

Basically Unix/command line tools who can't handle file/path names with space characters are broken and need to be fixed.

One way out of this could be (haven't tried it) to

  • Rename the SSD to MySSD
  • Run cd /Volumes; sudo ln -s MySSD "My SSD"

Depending on how your media library works re-indexing might still occur though.

  • 1
    You are a genius! ;) I am accepting this answer because "or alternative solutions" is part of my question. Hopefully re-indexing won't happen – John Oct 12 '18 at 16:39

You must log in to answer this question.

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