• 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: File URL to Alias?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: File URL to Alias?


  • Subject: Re: File URL to Alias?
  • From: Ron Hunsinger <email@hidden>
  • Date: Tue, 25 Feb 2014 16:49:18 -0800


On Feb 25, 2014, at 5:21 AM, koenig.yvan <email@hidden> wrote:
In fact, URLs created under Mavericks are supposed to no longer include localhost.

I'm not sure what you mean by "supposed to". Apple takes great pains to be standards-compliant wherever possible.

According to RFC 1738: Uniform Resource Locators (URL)
3.10 FILES

   The file URL scheme is used to designate files accessible on a
   particular host computer. This scheme, unlike most other URL schemes,
   does not designate a resource that is universally accessible over the
   Internet.

   A file URL takes the form:

       file://<host>/<path>

   where <host> is the fully qualified domain name of the system on
   which the <path> is accessible, and <path> is a hierarchical
   directory path of the form <directory>/<directory>/.../<name>.

   For example, a VMS file

     DISK$USER:[MY.NOTES]NOTE123456.TXT

   might become

     <URL:file://vms.host.edu/disk$user/my/notes/note12345.txt>

   As a special case, <host> can be the string "localhost" or the empty
   string; this is interpreted as `the machine from which the URL is
   being interpreted'.

   The file URL scheme is unusual in that it does not specify an
   Internet protocol or access method for such files; as such, its
   utility in network protocols between hosts is limited.

That is, the standard says that specifying or omitting "localhost" are equally valid.

The general dictum known as Postel's Law (aka "Robustness Principle", see http://en.wikipedia.org/wiki/Robustness_principle) says: be conservative in what you do, be liberal in what you accept from others.

In particular, when you receive a file: URL from someone else, be liberal about how you interpret it. Your code must be prepared to properly handle file: URLs whether the optional "localhost" is present or absent. For completeness, it should also allow an arbitrary FQDN in that position (but you can reasonable insist that the FQDN must resolve to (an interface on) the same computer as "localhost", because otherwise there's no standard way to actually access the file).

-Ron Hunsinger

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: File URL to Alias?
      • From: Shane Stanley <email@hidden>
    • Re: File URL to Alias?
      • From: Shane Stanley <email@hidden>
References: 
 >File URL to Alias? (From: Christopher Stone <email@hidden>)
 >Re: File URL to Alias? (From: "koenig.yvan" <email@hidden>)
 >Re: File URL to Alias? (From: Shane Stanley <email@hidden>)
 >Re: File URL to Alias? (From: Shane Stanley <email@hidden>)
 >Re: File URL to Alias? (From: "koenig.yvan" <email@hidden>)

  • Prev by Date: Re: Save as run only
  • Next by Date: Re: File URL to Alias?
  • Previous by thread: Re: File URL to Alias?
  • Next by thread: Re: File URL to Alias?
  • Index(es):
    • Date
    • Thread