Files on Unix systems all live in a single tree. Hard drives, networked filesystems and imaginary files invented by the kernel are all mounted onto the same tree.
There are two types of file path: absolute paths (which start with a slash) and relative paths (which don't). And there's one type of separator in paths, the forward slash.
Microsoft Windows is... different.
Dealing with the last issue first, the busybox-w32 README says:
On the other hand, the Unix shell uses the backslash as an escape character, which makes using them in paths inconvenient. You either need to use double backslashes or put your path in single quotes so the backslash isn't treated as special. Using forward slashes is much simpler.
C:)
//HOST/Share)
With this knowledge we can define an absolute path in Windows: it's one that starts with a root specifier (drive or share) followed by a slash. Thus the following are absolute paths:
C:/Users/rmy C:/Windows/System32 //NAS/Media/thing.mp4An absolute path is an unambiguous reference to a file on a drive or a networked filesystem.
Before looking at relative paths in Windows there's one other concept we need to consider: the current working directory.
The shell builtin cd allows you to change the current working
directory and pwd prints it.
cmd.exe) also
has the notion of a current directory but with a couple of significant
differences:
cd
to a UNC path you'll get an error. A share can be accessed if it's
mapped to a drive letter.
pwd builtin takes an optional -a
argument to print the current directory of all drives. Without
-a it only prints the current directory for the current drive.
path/to/file). It's relative to the current directory
of the current root.
C:path/to/file).
This is relative to the current directory of the specified drive.
/path/to/file). This is
relative to the current root. On Unix it would be an absolute path.
To avoid ambiguity busybox-w32 applies special treatment to paths of this form in certain cases:
/etc/profile) are treated as relative
to the system drive, the one specified in the SYSTEMDRIVE
environment variable. This can be overridden by setting the
BB_SYSTEMROOT environment variable.
/bin/sh)
and runs the corresponding applet, if it exists.