The file URI Scheme is a URI scheme defined in , typically used to retrieve files from within one's own computer. Previously the file URI scheme was specified in and . The Internet Engineering Task Force (IETF) published RFC 8089, updating the latter RFC, with "a syntax based on the generic syntax of that is compatible with most existing usages." Format A file URI takes the form of 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:///foo.txt" is valid, "file://foo.txt" is not, although some interpreters manage to handle the latter). RFC 3986 includes additional information about the treatment of ".." and "." segments in URIs. How many slashes? The // after the file: denotes that either a hostname or the literal term localhost will follow, although this part may be omitted entirely, or may contain an empty hostname. The single slash between host and path denotes the start of the local-path part of the URI and must be present. 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). There are two ways that Windows UNC filenames (such as \\server\folder\data.xml) can be represented. These are both described in RFC 8089, Appendix E as "non-standard". The first way (called here the 2-slash format) is to represent the server name using the Authority part of the URI, which then becomes file://server/folder/data.xml. The second way (called here the 4-slash format) is to represent the server name as part of the Path component, so the URI becomes file:////server/folder/data.xml. Both forms are actively used. Microsoft .NET (for example, the method new Uri(path)) generally uses the 2-slash form; Java (for example, the method new URI(path)) generally uses the 4-slash form. Either form allows the most common