Windows filesystem
· Windows · #note/sink · #sys/health · #sys/network ·
Windows URI scheme
Format
A file URI has the format
file://host/path
where host is the fully qualified domain name
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, 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), orfile://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
in Windows
file://localhost/c:/WINDOWS/clock.avi
file:///c:/WINDOWS/clock.avi
the URI as understood by the Windows Shell API
file://hostname/path/to/the%20file.txt
for a network location
file:///c:/path/to/the%20file.txt
local file, the hostname is omitted, but the slash is not (note the third slash)
\\.\c:\path\to\the file.txt
will work for local files, but not shares on the local system
\\?\C:\Test\Foo.txt
skip path normalization (?)
\\.\Volume{b75e2c83-0000-0000-0000-602f00000000}\Test\Foo.txt
GUID identificator for a volume
\\.\UNC\LOCALHOST\c$\temp\test-file.txt
Windows symbolic links
Symbolic links
for files and folders
REM list any type of link inside current directory
dir /al
Soft links
aka Junctions / reparse points
for folders
REM create junction
mklink /J <filename> <filename>
REM query and delete
fsutil reparsepoint query <filename>
fsutil reparsepoint delete <filename>
Hard links
for files