[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lynx-dev file://foo/
From: |
Miles O'Neal |
Subject: |
Re: lynx-dev file://foo/ |
Date: |
Thu, 9 Oct 2003 23:38:23 -0500 (CDT) |
=?ISO-8859-1?Q?Fr=E9d=E9ric_L=2E_W=2E_Meunier?= said...
|OK. I just never thought file:// and ftp:// would do the same
|thing.
|
|ELinks and Links2: file:// -> pwd of the shell, but
|file://home/ -> "No such file or directory".
|
|Mozilla: file:// -> file:/// , but file://foo -> file:///
|
|Opera: file:// -> file:/// , and file://home -> file://home
|(/home).
|
|I don't know what's the "right thing".
According to RFC 1738 by Tim Berners-Lee:
----------------------------------------------------------
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.
----------------------------------------------------------
So it doesn't specify a protocol. Most people look at the word
"file" and assume "local". If they know much more, they read
somewhere that no protocol was specified, so they assume there
is no protocol involved. But because it's vague, it means that
the implementer can do whatever they like. Theapproach that was
more or less standardized on (at least across most operating
systems that sup[port FTP) is described in
http://www.netspace.org/users/dwb/url-guide.html :
----------------------------------------------------------
Host-Specific File Names (File)
The File URL scheme indicates a file which can be obtained by
the client machine. In many sources, this scheme is confused
with the FTP scheme. FTP refers to a specific protocol for
file transmission, and while the File URL leaves the retrieval
method up to the client, which in some circumstances, might be
via the FTP protocol. When the file is intended to be obtained
via FTP, I recommend designating that URL scheme. The syntax
for the File scheme is:
file://<host>/<path>
The host is the fully qualified domain name of the system, and
the path is the hierarchical directory path of the form
"directory/directory/.../filename". The host can be left as
an empty string or "localhost" to refer to local files on the
client on which the URL is being interpreted.
----------------------------------------------------------
So, the way it tends to work is, if you see either of these:
file:/filename
file:///filename
it's a local file. If you see
file://hostname/filename
the client might implement it one of two ways:
1) If hostname is the local host, go look for filename
locally; otherwise try ftp (or some other protocol
if you have a way of detecting the need and using
it).
2) Just try ftp, regardless.
The latter is obviously easier, but less efficient for local
files. It also has the downside of breaking if ftp is not
enabled. So the prefered approach is #1.
I won't say that this is *the* right thing to do, but it
is certainly a correct approach that leaves as little to
chance as possible, and has the best odds of retrieving
the file under any circumstances.
-Miles
; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden