Hey everyone,
Is there a system library for escaping a file system path for iPhone development? I have to read and write files where the file name is based on 3rd party values so I want to make sure the paths I'm actually writing to are nice and safe.
I would have thought there was an NS library that would do this for me, since this is the "simple" type of function every developer probably shouldn't be rewriting, but I can't find it if there is one.
Thanks!
Edit: Thanks for the reply, stringByStandardizingPath: looks good for getting a real file path for a string, but what I'm looking for would do something similar to the following:
in: @"~/Foo/Bar"
out: @"__Foo_Bar" or @"FooBar" etc.
Basically it would strip any unsafe characters out of a file path component.
After continued research it looks like almost any unicode character besides '/' is allowed in a file path. However, file paths are usually fragile and can be manipulated by an escape sequence, etc. so I'm hoping the big brains at Apple have an API to strip a file path component of unsafe values.