A file path can be eitheran absolute file path or a relative file path. In an absolute file path, the base of the file hierarchy is specified, along with the name of each directory and subdirectory to the final directory where the filename exists. The base of the file hierarchy is also called therootof the file hierarchy tree. In a relative file path, only the portions of the path relative to the current program location are required.
The structure of an absolute file path varies from one filesystem to another. It may have a generic root or it may begin with the name of the device where the file hierarchy exists. For instance, on Unix and Linux systems, all files exist somewhere in the file hierarchy with the root beginning with /. On Windows, the root of a file hierarchy typically begins with a device identifier, such as D:.
Thankfully, there are many common features that we can rely upon. Once the base of the file hierarchy, or the...