Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Slash "/" in disk name.

Slash "/" in disk name.
Thread Tools
Forum Regular
Join Date: Jun 2000
Location: Freiburg
Status: Offline
Reply With Quote
Sep 15, 2003, 12:56 PM
 
Is it OK to use slashes in a disk name, for example "aa/mm/zz" ?
Cheers, Hans M. Aus, Würzburg,
     
Posting Junkie
Join Date: May 2001
Location: Brisbane, Australia
Status: Offline
Reply With Quote
Sep 15, 2003, 01:07 PM
 
Yes. It will translate it to a : in the filesystem

Why didn't you try this before asking the question here

[ fb ] [ flickr ] [♬] [scl] [ last ] [ plaxo ]
     
Addicted to MacNN
Join Date: Jan 2001
Location: The Sar Chasm
Status: Offline
Reply With Quote
Sep 15, 2003, 01:07 PM
 
I would think not, since UNIX uses slashes to denote directories.

edit: Then again, what do I know?

CV

When a true genius appears in the world you may know him by this sign, that the dunces are all in confederacy against him. -- Jonathan Swift.
     
Mac Elite
Join Date: Nov 2001
Location: Trafalmadore
Status: Offline
Reply With Quote
Sep 15, 2003, 01:07 PM
 
You can use slashes, but I wouldn't. You will more than likely run into problems when using some installers or command line syntax in terminal.
If I name my disk OS/X it will appears as OS:X in terminal. Not good.
     
Addicted to MacNN
Join Date: Sep 2000
Location: Isle of Manhattan
Status: Offline
Reply With Quote
Sep 15, 2003, 02:25 PM
 
Originally posted by SMacTech:
You can use slashes, but I wouldn't. You will more than likely run into problems when using some installers or command line syntax in terminal.
If I name my disk OS/X it will appears as OS:X in terminal. Not good.
Same thing with parens. ( = \\, I think.
It's a pain, because there were no naming restrictions in OS 9, so some old stuff is troublesome until everything is renamed. It's best to use the legal chars only.
     
Grizzled Veteran
Join Date: Jan 2001
Location: Evansville, IN
Status: Offline
Reply With Quote
Sep 15, 2003, 02:38 PM
 
Just use dashes or underscores. There's no potential problem with them.
     
Dedicated MacNNer
Join Date: Jan 2001
Location: Badfort
Status: Offline
Reply With Quote
Sep 15, 2003, 02:57 PM
 
Originally posted by osiris:
Same thing with parens. ( = \\, I think.
It's a pain, because there were no naming restrictions in OS 9, so some old stuff is troublesome until everything is renamed. It's best to use the legal chars only.
The only proscribed character is slash '/', the path separator, which is mapped to a colon ':'. The finder, will however, disallow a colon, presumably something to do with how carbon apps access the filesystem ( colons were the Classic path separator). In limited testing, cocoa apps (TextEdit) will substitute dashes for either, whereas Carbon apps (Word, BBEdit 6.5) simply ignore the keystroke. I'm sure someone will elucidate. OS 9 would not allow colons, either, so i guess it's safer to avoid both separators
You see, my friends, pirates are the key. - thalo
     
Mac Elite
Join Date: Oct 2000
Location: Edinburgh, Scotland
Status: Offline
Reply With Quote
Sep 15, 2003, 04:36 PM
 
I have come across no problems using the forward slash "/" in filenames, ever. The finder allows creating files names with that character, cocoa applications do not.

You're fine as long as you remember to "escape" the slash when you're using a cocoa app or the terminal. By escaping it, I just mean putting a backslash in before the slash. You also need to do that with the space character in the terminal. Example:

My CV 15/9/03.pdf

in the terminal, it would be referenced as

My\ CV\ 15\/9\/03.pdf

As long as you remember that, you'll encounter no problems....but as previously said, it might just be easier to avoid unless it's unavoidable!
ClamXav - the free virus scanner for Mac OS X | Geobunny learns to fly
     
Addicted to MacNN
Join Date: Nov 2002
Location: Seattle, WA
Status: Offline
Reply With Quote
Sep 15, 2003, 05:10 PM
 
Originally posted by osiris:
Same thing with parens. ( = \\, I think.
It's a pain, because there were no naming restrictions in OS 9, so some old stuff is troublesome until everything is renamed. It's best to use the legal chars only.
that's bull. I use parens all the time, and as pointed out above, OS <X didn't allow colon. So the old system restricted one character (colon) and the new system restricts one character (forward slash). And if you never use the terminal you'd never know the difference anyway, because the Finder allows the slash and not the colon. If certain apps behave differently, it's the apps' fault, because the filesystem is as flexible as it's always been.
     
Professional Poster
Join Date: Nov 2000
Location: Tasmania, Australia
Status: Offline
Reply With Quote
Sep 15, 2003, 06:29 PM
 
Originally posted by Geobunny:
I have come across no problems using the forward slash "/" in filenames, ever. The finder allows creating files names with that character, cocoa applications do not.

You're fine as long as you remember to "escape" the slash when you're using a cocoa app or the terminal. By escaping it, I just mean putting a backslash in before the slash. You also need to do that with the space character in the terminal. Example:

My CV 15/9/03.pdf

in the terminal, it would be referenced as

My\ CV\ 15\/9\/03.pdf

As long as you remember that, you'll encounter no problems....but as previously said, it might just be easier to avoid unless it's unavoidable!
Have you actually tried this? I cannot create a file in the terminal (in a shell) with a slash in it, and I think this would be the same with any Unix. You cannot have a "/" in a file name. Even escaping it doesn't work.

Try to

touch blah\/blah

and you get "No such file or directory".
     
Professional Poster
Join Date: Nov 2000
Location: Tasmania, Australia
Status: Offline
Reply With Quote
Sep 15, 2003, 06:30 PM
 
Originally posted by Uncle Skeleton:
that's bull. I use parens all the time, and as pointed out above, OS <X didn't allow colon. So the old system restricted one character (colon) and the new system restricts one character (forward slash). And if you never use the terminal you'd never know the difference anyway, because the Finder allows the slash and not the colon. If certain apps behave differently, it's the apps' fault, because the filesystem is as flexible as it's always been.
You are correct, however it's best to avoid both "/" and ":" characters in filenames due to the fact that different applications may handle them differently.
     
Forum Regular
Join Date: Jun 2000
Location: Freiburg
Status: Offline
Reply With Quote
Sep 15, 2003, 06:36 PM
 
Many thanks for your replys, which explain why EndNote 7 exits unexpectedly on start up. The installation was okay but EndNote is apparently looking for files in a non-existing folder.
Cheers, Hans M. Aus, Würzburg,
     
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Sep 15, 2003, 06:39 PM
 
Originally posted by Jellytussle:
The only proscribed character is slash '/', the path separator, which is mapped to a colon ':'.
As I understand it, it's the other way around. The one and only character that is disallowed, in both OS 9 and OS X, is the colon ':' since it was, and still is, the HFS+ path separator. Of course, the BSD API's expect the separator to be a slash, '/', so any slashes in filenames get mapped to colons ':' to BSD API's. Since Cocoa uses the BSD API's, it inherits this behavior. But in the actual file system, filenames are the way they appear in Carbon apps - the slash is allowed and the colon is not.

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
Addicted to MacNN
Join Date: Sep 2000
Location: Isle of Manhattan
Status: Offline
Reply With Quote
Sep 15, 2003, 06:46 PM
 
Originally posted by Uncle Skeleton:
that's bull. I use parens all the time, and as pointed out above, OS <X didn't allow colon. So the old system restricted one character (colon) and the new system restricts one character (forward slash). And if you never use the terminal you'd never know the difference anyway, because the Finder allows the slash and not the colon. If certain apps behave differently, it's the apps' fault, because the filesystem is as flexible as it's always been.
Then why do items with a paren show up as "\\"? It's not bull, though the problem is not technically restricting, it is visually confusing. To me that's a problem that didn't exist in 9.
     
Addicted to MacNN
Join Date: Apr 2001
Location: europe
Status: Offline
Reply With Quote
Sep 15, 2003, 06:49 PM
 
Originally posted by Hans M Aus:
Many thanks for your replys, which explain why EndNote 7 exits unexpectedly on start up. The installation was okay but EndNote is apparently looking for files in a non-existing folder.
In any case ü is an allowed character, so is there any reason you are not spelling Würzburg correctly?
Nasrudin sat on a river bank when someone shouted to him from the opposite side: "Hey! how do I get across?" "You are across!" Nasrudin shouted back.
     
Professional Poster
Join Date: Nov 2000
Location: Tasmania, Australia
Status: Offline
Reply With Quote
Sep 16, 2003, 12:45 AM
 
Originally posted by CharlesS:
As I understand it, it's the other way around. The one and only character that is disallowed, in both OS 9 and OS X, is the colon ':' since it was, and still is, the HFS+ path separator. Of course, the BSD API's expect the separator to be a slash, '/', so any slashes in filenames get mapped to colons ':' to BSD API's. Since Cocoa uses the BSD API's, it inherits this behavior. But in the actual file system, filenames are the way they appear in Carbon apps - the slash is allowed and the colon is not.
The separator is not part of the file system, it is just what the OS (and/or applications) uses to represent items in the file system. Therefore in OS 9, ":" is the only character not allowed. In OS X, "/" is the only character not allowed, although many OS X applications (including the Finder" do a kludge whereby they swap a ":" for a "/" to make it look like it's working the same way as OS 9.
     
Addicted to MacNN
Join Date: Nov 2002
Location: Seattle, WA
Status: Offline
Reply With Quote
Sep 16, 2003, 12:54 AM
 
Originally posted by osiris:
Then why do items with a paren show up as "\\"? It's not bull, though the problem is not technically restricting, it is visually confusing. To me that's a problem that didn't exist in 9.
I've never seen a \\, and in fact I tested it just before posting. A folder named in the finder to (\|/) showed in the terminal as (\|:)

so...what are you talking about?
     
Posting Junkie
Join Date: Nov 2000
Location: in front of my Mac
Status: Offline
Reply With Quote
Sep 16, 2003, 02:31 AM
 
Originally posted by Brass:
Have you actually tried this? I cannot create a file in the terminal (in a shell) with a slash in it, and I think this would be the same with any Unix. You cannot have a "/" in a file name. Even escaping it doesn't work.

Try to

touch blah\/blah

and you get "No such file or directory".
The / is always forbidden, also on my csh, bash and zsh on Linux. That's why OS X always replace it wth a :

Anything else seems to work including spaces. If you don't like the to mask special characters with a / like the space here

touch blah\ blah

you can instead also use this

touch 'blah blah'

or this

touch "blah blah"
(Last edited by Simon; Sep 16, 2003 at 02:39 AM. )
•
     
Forum Regular
Join Date: Jun 2000
Location: Freiburg
Status: Offline
Reply With Quote
Sep 16, 2003, 04:05 AM
 
This morning I removed the slashes from the OSX disk name and EndNote 7 starts properly.
Cheers, Hans M. Aus, Würzburg,
     
Forum Regular
Join Date: Jun 2000
Location: Freiburg
Status: Offline
Reply With Quote
Sep 16, 2003, 04:35 AM
 
This morning I removed the slashes from the OSX disk name and EndNote 7 starts properly.
Cheers, Hans M. Aus, Würzburg,
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 08:29 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2