GetWiki
file URI scheme
ARTICLE SUBJECTS
being →
database →
ethics →
fiction →
history →
internet →
language →
linux →
logic →
method →
news →
policy →
purpose →
religion →
science →
software →
truth →
unix →
wiki →
ARTICLE TYPES
essay →
feed →
help →
system →
wiki →
ARTICLE ORIGINS
critical →
forked →
imported →
original →
file URI scheme
please note:
- the content below is remote from Wikipedia
- it has been imported raw for GetWiki
{{Short description|Uniform Resource Identifier scheme for files}}In programming, a file uniform resource identifier (URI) scheme is a specific format of URI, used to specifically identify a file on a host computer. While URIs can be used to identify anything, there is specific syntax associated with identifying files.REPORT,weblink The "file" URI Scheme, Kerwin, Matthew, February 2017, Internet Engineering Task Force, RFC 8089, WEB, What is a Uniform Resource Identifier (URI)?,weblink 2023-09-12, WhatIs.com, en, - the content below is remote from Wikipedia
- it has been imported raw for GetWiki
Format
A file URI has the format
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. If host is omitted, it is taken to be "localhost", the machine from which the URL is being interpreted. Note that when omitting host, the slash is not omitted (while "file:piro.txt" is valid, "file:simpen.txt" is not, although some interpreters manage to handle the latter).RFC 3986 includes additional information about the treatment of ".." and "." segments in URIs.Number of slash characters
- The character sequence of two slash characters (//) after the string file: denotes that either a hostname or the literal term localhost follows,RFC 8089, Section 2 although this part may be omitted entirely, or may contain an empty hostname.RFC 3986, Section 3.2.2
- The single slash between host and path denotes the start of the local-path part of the URI and must be present.RFC 3986, Section 3.3
- A valid file URI must therefore begin with either file:/path (no hostname), file:path (empty hostname), or file:hostname/path.
- file://path (i.e. two slashes, without a hostname) is never correct, but is often used.
- Further slashes in path separate directory names in a hierarchical system of directories and subdirectories. In this usage, the slash is a general, system-independent way of separating the parts, and in a particular host system it might be used as such in any pathname (as in Unix systems).
Examples
Unix
Here are two Unix examples pointing to the same /etc/fstab file:
file://localhost/etc/fstab
file:///etc/fstab
The KDE environment uses URIs without an authority field:
file:///etc/fstab
file:/etc/fstab
Windows
Here are some examples which may be accepted by some applications on Windows systems, referring to the same, local file c:'WINDOWS'clock.avi
file://localhost/c:/WINDOWS/clock.avi
file:///c:/WINDOWS/clock.avi
Here is the URI as understood by the Windows Shell API:WEB, Risney, Dave, 2006, File URIs in Windows,weblink 2020-10-02, IEBlog, Microsoft Corporation, file:///c:/WINDOWS/clock.avi
file:///c:/WINDOWS/clock.avi
Note that the drive letter followed by a colon and slash is part of the acceptable file URI.Implementations
Windows
On Microsoft Windows systems, the normal colon (:) after a device letter has sometimes been replaced by a vertical bar (|) in file URLs. This reflected the original URL syntax, which made the colon a reserved character in a path part.Since Internet Explorer 4, file URIs have been standardized on Windows, and should follow the following scheme. This applies to all applications which use URLMON or SHLWAPI for parsing, fetching or binding to URIs. To convert a path to a URL, use UrlCreateFromPath, and to convert a URL to a path, use PathCreateFromUrl.To access a file "the file.txt", the following might be used.For a network location:
file://hostname/path/to/the%20file.txt
Or for a local file, the hostname is omitted, but the slash is not (note the third slash):
file:///c:/path/to/the%20file.txt
This is not the same as providing the string "localhost" or the dot "." in place of the hostname. The string "localhost" will attempt to access the file as UNC path localhostc:pathtothe file.txt, which will not work since the colon is not allowed in a share name. The dot "." results in the string being passed as .c:pathtothe file.txt, which will work for local files, but not shares on the local system. For example file://./sharename/path/to/the%20file.txt will not work, because it will result in sharename being interpreted as part of the DOSDEVICES namespace, not as a network share.The following outline roughly describes the requirements. - The colon should be used, and should not be replaced with a vertical bar for Internet Explorer.
- Forward slashes should be used to delimit paths.
- Characters such as the hash () or question mark (?) which are part of the filename should be percent-encoded.
- Characters which are not allowed in URIs, but which are allowed in filenames, must also be percent-encoded. For example, any of "{}`^ " and all control characters. In the example above, the space in the filename is encoded as %20.
- Characters which are allowed in both URIs and filenames must NOT be percent-encoded.
- Must not use legacy ACP encodings. (ACP code pages are specified by DOS CHCP or Windows Control Panel language setting.)
- Unicode characters outside of the ASCII range must be UTF-8 encoded, and those UTF-8 encodings must be percent-encoded.
Legacy URLs
To aid the installed base of legacy applications on Win32 PathCreateFromUrl recognizes certain URLs which do not meet these criteria, and treats them uniformly. These are called "legacy" file URLs as opposed to "healthy" file URLs.weblink" title="web.archive.org/web/20130116070556weblink">The Bizarre and Unhappy Story of 'file:' URLs - Free Associations - Site Home - MSDN Blogs. Blogs.msdn.com (2005-05-19). Retrieved on 2014-03-08.In the past, a variety of other applications have used other systems. Some added an additional two slashes. For example, UNC path remotehostsharedirfile.txt would become file:/remotehost/share/dir/file.txt instead of the "healthy" file:remotehost/share/dir/file.txt.Web pages
File URLs are rarely used in Web pages on the public Internet, since they imply that a file exists on the designated host. The host specifier can be used to retrieve a file from an external source, although no specific file-retrieval protocol is specified; and using it should result in a message that informs the user that no mechanism to access that machine is available.References
{{Reflist}}{{URI scheme}}- content above as imported from Wikipedia
- "file URI scheme" does not exist on GetWiki (yet)
- time: 6:01pm EDT - Wed, May 01 2024
- "file URI scheme" does not exist on GetWiki (yet)
- time: 6:01pm EDT - Wed, May 01 2024
[ this remote article is provided by Wikipedia ]
LATEST EDITS [ see all ]
GETWIKI 23 MAY 2022
The Illusion of Choice
Culture
Culture
GETWIKI 09 JUL 2019
Eastern Philosophy
History of Philosophy
History of Philosophy
GETWIKI 09 MAY 2016
GetMeta:About
GetWiki
GetWiki
GETWIKI 18 OCT 2015
M.R.M. Parrott
Biographies
Biographies
GETWIKI 20 AUG 2014
GetMeta:News
GetWiki
GetWiki
© 2024 M.R.M. PARROTT | ALL RIGHTS RESERVED