Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'The mystery solved (?)' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
The mystery solved (?)
Authored by: eggert on Mar 31, '02 09:04:38AM

In Unix you can't have a forward slash (/) in a file name. That's it.

In Carbon applications you can, but you are in fact deceived. The forward slash (/) will be replaced by a colon (:). The (:) will show up as a forward slash (/), but if you checkin the Terminal.app you'll see the (:).

To avoid this confusion (most) MacOS X applications won't let you save files with either (:) or (/) in the name. These characters will be replaced with a (-).



[ Reply to This | # ]
The mystery solved (?)
Authored by: phayd on Mar 31, '02 01:59:50PM

Actually what you way is _exactly_ the opposite of the truth.

In HFS+ the directory deliminator is a colon, therefore Mac OS X replaces all colons with forward slashes for the terminal. When you type a '/' in the terminal, you are actually typing a ':', just like in Mac OS 9. This was done for POSIX compliance, and source compatibility with applications such as apache, which expect slashes, instead of colons.

Also - UNIX does not restrict the characters that you use in a filename. There is an escape character that allows the user to use any character in a filename.

Carbon apps (and cocoa apps can too, IIRC) see the directory characters for what they are: colons.



[ Reply to This | # ]
The mystery solved (?)
Authored by: garbanzito on Apr 01, '02 01:25:52AM

correct that ":" is the internal HFS+ path delimiter and that it is converted into "/" for shell/unix purposes. so "/" is a legal character in filenames from the standpoint of non-shell applications, Finder, etc., and conversely ":" is a legal character from the shell/unix standpoint.

there is quite a lot of misinformation on this issue. it's really too bad that it has to be mysterious or that people should make claims about it without actually trying it. i encourage everyone to do a few simple experiments in Finder and the shell to reinforce this knowledge.



[ Reply to This | # ]