Paths
A user or script can request access to a file using an absolute file specification or a relative file specification. An absolute file specification provides the directory and subdirectory hierarchy path to locate the target file. A relative file specification locates the target file relative to the current working directory. The following example starts by accessing a file using a relative file specification. After changing the default directory, the relative file spec no longer works, but an absolute file spec will always work no matter where your directory default is currently.
The following example successfully uses a relative file specification, changes the default directory, and then fails when attempting to re-execute the same command ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access