On Apr 15, 2009, at 10:51 AM, Keary Suska wrote:

On Apr 14, 2009, at 5:57 PM, Dragan Milić wrote:

Hell all,

Let's suppose I've got NSString @"C:omponent" , which represents the name of a file. Is there a way to instruct NSString class not to treat a leading single letter followed by a column as a path separator? Namely, I need this one treated as only one path component @"C:omponent", but NSString sees two, @"C:" and "omponent". So, if I ask for the last path component, I get @"omponent" instead of the whole string @"C:omponent".

I don't believe so, as I believe colon-separators are are deeply ingrained into the file system. You will probably need to parse the path names yourself. Look at one of the regex libraries for easy parsing.

"Carbon is not dead, it just smells funny."

I tried this, and it doesn't seem to have anything to do with HFS+ paths, as Cocoa abstracts colons away into slashes there anyway. What's more, it only does this if you have only one letter before the colon, as in @"C:omponent". If you use @"CC:omponent" instead, it doesn't split it. If anything, it seems to look like it's thinking the path is an MS-DOS path which starts with a drive letter.

Charles_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to