On 29 Apr 09, at 06:15, Mark Douma wrote:
If you are working with file paths, you shouldn't be using componentsSeparatedByString:, nor should you be defining "/" to be the component you should be separating by. What if someone had your app inside of a folder they named "Apps/Utilities"? The HFS+ filesystem actually uses a colon as the path separator, so having a / in the name of a file or folder is perfectly acceptable, but would likely cause a headache and unexpected results if your code were to encounter it. (Go to the Finder and try adding a /).

What you're saying here is incredibly misleading, and actively harmful. While I believe that HFS+ uses ":" as a path separator on- disk, virtually all non-Carbon userspace code makes use of UNIX paths. Either Carbon or the Finder itself is swapping colons and slashes for display purposes - running "ls" should reveal that filenames which appear as slashes in the Finder appear as colons.

Indeed, the methods in NSPathUtilities are entirely equivalent to string manipulation methods which split and join on slashes. They handle a lot of special cases for you (absolute paths, for instance), but they are in no way doing anything specific to HFS+. Moreover, you can rely on the path separator remaining a slash for the foreseeable future.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to