• 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
Using a string as filepath
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using a string as filepath


  • Subject: Using a string as filepath
  • From: Knut Lorenzen <email@hidden>
  • Date: Thu, 27 Nov 2008 01:09:11 +0100

Dear list,

I would like to name a file according to an user defined entry. However, the user's name entry might be illegal as a filepath, containing illegal characters for a pathname like "." or "-" as 1st character, "/", ":", etc.

I've looked into the Cocoa docs for NSString and NSFileManager to no avail.

Is there a recommended way to "clean" an NSString in order to get a valid filepath? One could simply replace all suspicious characters with an underscore (or something else), but that is not very elegant and feels like fighting the framework.

Cheers,

Knut

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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: Using a string as filepath
      • From: Tommy Nordgren <email@hidden>
    • Re: Using a string as filepath
      • From: "Michael Ash" <email@hidden>
    • Re: Using a string as filepath
      • From: Kiel Gillard <email@hidden>
  • Prev by Date: Re: Figure out the size of an NSAttributedString
  • Next by Date: Re: Using a string as filepath
  • Previous by thread: Re: Core Data modeling question
  • Next by thread: Re: Using a string as filepath
  • Index(es):
    • Date
    • Thread