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

Re: Using a string as filepath


  • Subject: Re: Using a string as filepath
  • From: Knut Lorenzen <email@hidden>
  • Date: Fri, 28 Nov 2008 20:52:51 +0100


Am 28.11.2008 um 19:22 schrieb Tommy Nordgren:

try using -[NSString fileSystemRepresentation]

Actually, that was my 1st attempt :)

Meanwhile I have a solution better than replacing all potentially "evil" characters with an underscore:

for( i = 0; i < [temporaryPath length]; i++) {
if( [temporaryPath characterAtIndex: i] < 0x20 ) [cleanPath appendString: @" "];
// replace non-printable chars with a space


else if( [temporaryPath characterAtIndex: i] == ':' ) [cleanPath appendString: @"-"];
//replace directory identifier with a dash


else [cleanPath appendFormat: @"%C", [temporaryPath characterAtIndex: i]];
// let others go through
}


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


References: 
 >Using a string as filepath (From: Knut Lorenzen <email@hidden>)
 >Re: Using a string as filepath (From: Tommy Nordgren <email@hidden>)

  • Prev by Date: Main Thread stoppin Background Thread
  • Next by Date: Re: ... not sure if this is a KVO or a Core Audio problem with my code
  • Previous by thread: Re: Using a string as filepath
  • Next by thread: Scheme for efficiently archiving images.
  • Index(es):
    • Date
    • Thread