• 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: Why is NSString->FSRef so hard?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why is NSString->FSRef so hard?


  • Subject: Re: Why is NSString->FSRef so hard?
  • From: ERG Consultant <email@hidden>
  • Date: Thu, 30 Apr 2009 01:32:16 -0700 (PDT)

/ has been in use since the inception of unix in 1970 that's 39 years. I seriously doubt it's going to change anytime soon. In 39 more years, i'll be dead.

ERG

Sent from my iPod

On Apr 29, 2009, at 8:50 PM, Michael Ash <email@hidden> wrote:

On Wed, Apr 29, 2009 at 10:22 PM, Andrew Farmer <email@hidden> wrote:
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.

It is a baffling myth, and I can't understand how anyone with any
experience with the system would actually believe it. The OS goes
through a great deal of trouble to make HFS+ filesystems look and
behave exactly like any other UNIX-visible filesystem. Do you not use
Terminal? Do you not examine any of the hundreds or thousands of paths
flying through your application? They *all* use / as the path
separator.

(The reason a folder named Apps/Utilities does not break things is
because at the UNIX level this is represented as Apps:Utilities. / is
not allowed in filenames at that level, period. Doesn't matter what
filesystem you're on.)

Mike
_______________________________________________

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





_______________________________________________

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: Why is NSString->FSRef so hard?
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: Re: CA -animator animation only works the first time
  • Next by Date: Re: Registering Clients using DO
  • Previous by thread: Re: Why is NSString->FSRef so hard?
  • Next by thread: Re: Why is NSString->FSRef so hard?
  • Index(es):
    • Date
    • Thread