Using weird folder names on Mac OS X

I always liked the discrepancies between the actual filesystem as seen in a shell window and the GUI on the Mac. For a current software project, I needed to experiment with folder names containing colons: »:«. This is a valid character on Un*x like machines. On the Mac however, it is not possible to create a folder called »:::« – at least via the GUI. But it is of course using a shell. The result, however, is rather amusing :) :

bild-2.png

For those who are not familiar with shell commands I’d like to provide a little explanation:

  • Create a folder named »:::«
  • Use »ls« to check whether it went well. Looks fine.
  • Check the folder via the finder. It’s name now reads as »///«. WTF?!?
  • bild-1.png

  • So try to create a folder named »///«. Ah, it’s a directory?!? Heck!
  • Try to create a folder named »:::« again. Doh. File exists. Well…
  • Try to remove the folder named »///«. Is a directory. Hm. Thanks for the info.
  • Try to remove the folder named »:::«. Ah, it actually disappears, in the GUI as well as the shell.

Well, let’s try a folder containing german umlauts. »äöüÄÖÜß« seems to be an interesting approach :) :

bild-3.png

While typing the 7 umlauts, the shell immediately expanded it (I did not further investigate if it was unicode or anything else). While the folder does appear correctly in the Finder, »ls« does not show the expected result:

bild-4.png

Weird. That’s one of those famous “Don’t try at home” experiments, I guess ;-) .

2 Responses to “Using weird folder names on Mac OS X”

  1. Come over I’ll get you some useful stuff to chew on.

  2. ce says:

    Not necessary. As we cannot use colons and semicolons on Windows either, we just do some conversion to cope with keys and values like »addr:housenumber=5« or »amenity=restaurant;biergarten« in the Java code. RegEx-o-mania :) .