Re: getting a file by URL ?
Re: getting a file by URL ?
- Subject: Re: getting a file by URL ?
- From: Axel Luttgens <email@hidden>
- Date: Tue, 1 Jun 2010 17:11:56 +0200
Le 1 juin 2010 à 10:15:41, Thomas Fischer a écrit :
> [...]
>
> This leaves me puzzled:
>
> set myFile to POSIX file "file:///Users/Thomas/Desktop/Test.txt"
> log "myFile: " & myFile
> --> (*myFile: Macintosh HD:Users:Thomas:Desktop:Test.txt*)
> get POSIX path of myFile
>
> How can myFile in the last line have the value "file:///localhost/Users/Thomas/Desktop/Test.txt"?
>
> [...]
Hello Thomas,
Really three consecutive slashes in "file:///localhost..."?
I am unable to reproduce your result (perhaps not understanding what you are doing exactly, in which context), but you might be interested in RFC 1738, section 3.10:
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>.
[...]
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.
There are RFC 1808 and RFC 2396 as well (the latter providing a generalization known as URI).
Mac OS comes with classes (NSURL, CFURL) allowing to manipulate such urls, according to the rules that apply for such "objects".
HTH,
Axel
_______________________________________________
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