• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSString, path and "/" char
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSString, path and "/" char


  • Subject: Re: NSString, path and "/" char
  • From: "Clark Cox" <email@hidden>
  • Date: Fri, 24 Nov 2006 07:56:56 -0500

Filenames on MacOSX cannot contain '/', period. Any time the
Finder/file selection dialog shows a file with '/' in the name, that
is actually a ':' in the filename.

So, if the user wants you to put a '/' in a filename, simply replace
it with a ':'. If the user wants a ':' in the filename, either don't
allow it, or pass it through unchanged (in which case the user will
see a ':' if they look at the file in the Terminal, and a '/' if they
look at the file in the GUI).

On 11/23/06, Trygve Inda <email@hidden> wrote:
I am using:

urlPath = (NSURL *) CFURLCreateCopyAppendingPathComponent (NULL, (CFURLRef)
parentFolder, (CFStringRef) filename, false);

parentFolder is an NSURL and filename is an NSString

How can I properly handle the case where filename contains an "/"?

Basically I have a string that I want to turn into a filename and append to
a partial path, but the string might contain "/". Note that the string might
contain ":" as well so I need to deal with that case as well.

Thanks,

Trygve




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins (at) lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden



--
Clark S. Cox III
email@hidden
My CV/Resume:
http://homepage.mac.com/clarkcox3/files/Resume.pdf
http://homepage.mac.com/clarkcox3/files/Resume.html

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins (at) lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSString, path and "/" char
      • From: "Sean McBride" <email@hidden>
    • Re: NSString, path and "/" char
      • From: Trygve Inda <email@hidden>
References: 
 >NSString, path and "/" char (From: Trygve Inda <email@hidden>)

  • Prev by Date: Re: NUL characters in NSString cause unexpected results
  • Next by Date: Re: NSString, path and "/" char
  • Previous by thread: NSString, path and "/" char
  • Next by thread: Re: NSString, path and "/" char
  • Index(es):
    • Date
    • Thread