• 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: Root URL and URLByDeletingLastPathComponent
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Root URL and URLByDeletingLastPathComponent


  • Subject: Re: Root URL and URLByDeletingLastPathComponent
  • From: Jens Alfke <email@hidden>
  • Date: Sun, 17 Jul 2016 10:37:23 -0700

> On Jul 17, 2016, at 6:49 AM, email@hidden wrote:
>
>> It might be a mishandling of the two sorts of rot URL. If you try feeding in this URL manually:
>>
>> file://localhost/ <file:///>
>>
>> and removing the last component, what do you end up with?
>
> That just treats it as a file called "localhost" in the current directory.
>
> NSURL *rootURL = [NSURL fileURLWithPath:@"localhost"];

Not the same thing. The URL you created with the above is “file:///localhost” (three slashes at start) which is indeed just a file called “localhost”.

“file://localhost/“ (two slashes at start) denotes a file URL at the hostname “localhost”, which is semantically the same thing as “file:///", but syntactically different so the path behavior might work better. You’d have to create it as a generic URL, i.e. [NSURL URLWithString: @“file://localhost/“].

—Jens
_______________________________________________

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: 
 >Root URL and URLByDeletingLastPathComponent (From: email@hidden)
 >Re: Root URL and URLByDeletingLastPathComponent (From: Mike Abdullah <email@hidden>)
 >Re: Root URL and URLByDeletingLastPathComponent (From: email@hidden)

  • Prev by Date: Re: Root URL and URLByDeletingLastPathComponent
  • Next by Date: Re: Keyboard/Mouse Event Interaction
  • Previous by thread: Re: Root URL and URLByDeletingLastPathComponent
  • Next by thread: Re: Root URL and URLByDeletingLastPathComponent
  • Index(es):
    • Date
    • Thread