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


Click here to return to the 'You can use /' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
You can use /
Authored by: vonleigh on Feb 06, '03 07:54:28AM

Hello,

Did a quick test and got interesting results: Create a new folder, name the folder something with a forward slash in the name. For some reason it will allow you to do it (I have a recollection of the finder not allowing you to before, but I'm not sure).

If you look at the same file from the terminal, the forward slash will display as a colon. For those of you that don't know, there's a translation that goes on automatically from colon to slash, since HFS uses colons to separate folders and BSD uses /. You can read about it in a great paper by Wilfredo Sánchez:

<http://www.mit.edu/people/wsanchez/papers/USENIX_2000/>

Can anyone test OS X prior to Jaguar to see if it allowed you to use slashes? I wonder what the reasoning is behind it to allow you to use it now.


v



[ Reply to This | # ]
You can use /
Authored by: wtp on Feb 06, '03 10:38:25AM

Finder's actually displaying a ":".

In the bad old days of non-Unixy MacOS, a colon was used as the `path separator'. Unix has always used the forward slash as it's path separator, and so Mac users saw a change with MacOS X. To hide this change from the users, and confuse them, Finder.app shows files with ":" in their names as files with "/" in their names. If you open Terminal.app, however, ls will show you the true name. If you type "touch foo:bar" on the command line, it will create a file called foo:bar... look at that file in the Finder: "foo/bar".

The old MacOS accepted more characters in its filenames than Windows did, but not as much as Unix does. Unix only forbids the slash and ASCII NULL (it could be argued that the filesystem allows ASCII NULL, but Unix (and C!) really does not). Unix allows newlines, form feeds and other crazy things in its filenames. It is yet to be determined if these extra characters are a Big Mistake or a Bad Idea. In practice, shell wildcards, quotes, and even spaces are a little bit of a pain to use on the command line, and should be discouraged. So now, with OS X, Mac Users have greater flexibility, at the cost of some extra complexity. The choice is ultimately yours as to what you name your files, and how you want to shoot yourself in the foot. Just no "/" -- okay? :-)

[ Reply to This | # ]

You can use /
Authored by: sinanakay on May 03, '03 04:36:18AM

Hello everybody

I know there must be someone out there who already solved this problem:

I have thousands of filenames with "/" in them which I want to convert to "-" there must be a way to do that in terminal. Applescript shipped with the mac is not help.
TIA for any hints and pointers

Sinan



[ Reply to This | # ]