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

10.3: Name files with a slash Desktop
I'm not sure if this is new to Panther, but I can't remember that files and folders could be named with a slash (/) before.

[robg adds: I'm not positive, but I'm pretty sure this is new in Panther -- if it's not, please comment as such and I'll remove the hint...]
    •    
  • Currently 2.29 / 5
  You rated: 5 / 5 (7 votes cast)
 
[9,575 views]  

10.3: Name files with a slash | 14 comments | Create New Account
Click here to return to the '10.3: Name files with a slash' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.3: Name files with a slash
Authored by: simX on Dec 27, '03 05:33:35PM

Nope, this is in Jaguar, and I'm pretty sure it was always in Mac OS X. It doesn't actually name files as a slash, though -- it replaces the slash with a colon, but it appears as a slash in the Finder. The Finder doesn't allow you to use colons, though.

What's particularly funny is that Classic does the opposite (or something like that). It sees files with slashes in their filenames in the Finder (which are actually colons) that actually have slashes, and when you put a slash in the filename, it actually puts the slash, and it appears as a slash both in the Classic picker and in something like the Terminal when you do a directory listing.

It's really confusing how they got Classic and the Finder to work without hindering your ability to use slashes.

I wouldn't recommend deleting this hint, though -- it's useful to know that you can use slashes in the Finder without any problems.



[ Reply to This | # ]
10.3: Name files with a slash
Authored by: White Fire on Dec 27, '03 05:40:26PM

This was not present in 10.2.

Experiments with the terminal have told me how the Finder does this. It actually allows the user to use \ by simply replacing them with colons. Name a folder with a slash and then run ls in the Terminal if you don't believe me.

Cheers.

---
huwr@evula.org



[ Reply to This | # ]
10.3: Name files with a slash
Authored by: bhines on Dec 27, '03 10:07:16PM

You're wrong. It has always done exactly that, since 10.0.



[ Reply to This | # ]
10.3: Name files with a slash
Authored by: Greenfruit on Dec 27, '03 05:58:43PM

yes slashes have worked since i can remember, interestingly tough, i noticed you cant save from applescript editor witha files named with a slash, it just errors.

Im sure this is new in panther though as i saved the original applescripts from jaguar with slashes with no problems (that i can remember)

---
http://www.greenfruit.net/ - mysite | http://www.somefoolwitha.com/ - blog
"Coming up, I'll tell you exactly what to think." Chris Morris, Brass Eye
-iBook/G4



[ Reply to This | # ]
10.3: Name files with a slash
Authored by: greggo on Dec 28, '03 02:13:25PM
You can save a Folder with slashes in the name via AppleScript, try this...
tell application "Finder"
	make new folder with properties {name:"A/B"}
end tell
The above will create the folder "A/B" on your desktop. greggo macscripter.net

[ Reply to This | # ]
10.3: Name files with a slash
Authored by: Greenfruit on Dec 28, '03 06:36:14PM

I meant saving the actual applescript with a slash in the filename

---
http://www.greenfruit.net/ - mysite | http://www.somefoolwitha.com/ - blog
"Coming up, I'll tell you exactly what to think." Chris Morris, Brass Eye
-iBook/G4



[ Reply to This | # ]
10.3: Name files with a slash
Authored by: luhmann on Dec 27, '03 06:41:04PM

I actually had a problem with some software in Jaguar because I had a folder with a slash in the name. As a result, some UNIX based software which was being used as the engine behind a cocoa application couldn't work properly. I strongly recommend against trying to use slashes in file or folder names.



[ Reply to This | # ]
10.3: Name files with a slash
Authored by: kevinv on Dec 27, '03 10:11:46PM

I've had problems with Windows, but not Unix systems. If you were accessing a Unix box via Samba sharing you're restricted to the Windows character naming -- which disallows slashes (/), backslashes ([code]\[/code]) and colons (:).

Unix, and Mac OS X allows backslashes and colons in the name, but the forward slash is not allowed. As others have mentioned this slash in the name thing is accomplished by changing the slash to a colon.

When attempting to move my iTunes library to a Samba share I found out just how limited the windows character naming is. I switched to using NFS and all the filenaming problems went away.



[ Reply to This | # ]
10.3: Name files with a slash
Authored by: aranor on Dec 30, '03 02:12:58AM
When doing inline code, turn on HTML and use the tag instead.

[ Reply to This | # ]
10.3: Name files with a slash
Authored by: aranor on Dec 30, '03 02:15:54AM
GAH! Stupid preview! It turned my &lt;/&gt; entities into actual </> chars! I meant to say use the <tt> tag instead.

[ Reply to This | # ]
10.3: Name files with a slash
Authored by: cram on Dec 28, '03 07:18:50AM

It has always been here, and it is (I think) a conversion done in the Finder : a "/" in a filename is converted in a ":" in the Unix filename (as you can see with Terminal.

On the other hand, some Carbon programs use ":" in the path (like under Classic Mac OS), which are converted to "/" by the system.



[ Reply to This | # ]
10.3: Name files with a slash
Authored by: Tom Robinson on Dec 29, '03 02:13:36AM
A good explanation is from the paper 'The Challenges of Integrating the Unix and Mac OS Environments' which is still available at http://www.mit.edu/people/wsanchez/papers/USENIX_2000/, as follows:
Another obvious problem is the different path separators between HFS+ (colon, ':') and UFS (slash, '/'). This also means that HFS+ file names may contain the slash character and not colons, while the opposite is true for UFS file names. This was easy to address, though it involves transforming strings back and forth. The HFS+ implementation in the kernel's VFS layer converts colon to slash and vice versa when reading from and writing to the on-disk format. So on disk, the separator is a colon, but at the VFS layer (and therefore anything above it and the kernel, such as libc) it's a slash. However, the traditional Mac OS toolkits expect colons, so above the BSD layer, the core Carbon toolkit does yet another translation. The result is that Carbon applications see colons, and everyone else sees slashes. This can create a user-visible schizophrenia in the rare cases of file names containing colon characters, which appear to Carbon applications as slash characters, but to BSD programs and Cocoa applications as colons.
There do seem to be a number of inconsistent applications though. For instance, it was only in AppleScript 1.9.2 (shipped with 10.3) where:
The open for access command can now create a file whose name contains slashes or colons (whichever is not the native path separator for the path style in use). [3267270]
Cheers

[ Reply to This | # ]
why?
Authored by: macubergeek on Dec 30, '03 01:23:33PM

Why exactly would I want a file name that started with[code] \[/code] ?



[ Reply to This | # ]
10.3: Name files with a slash
Authored by: bryaneh on Dec 30, '03 08:15:51PM

I think it worked even in pre-OS X. I had file names of pictures with the date taken and a number at the end (Like 10/13/03 01). It got to be a real pain though when you burned them to a cd and tried to read them on a windows system, though. I had to switch to dashes.



[ Reply to This | # ]