Concept
What is the difference between absolute and relative file paths?
"When specifying a path we can either specify an absolute path or a relative path. An absolute path specifies each and every subdirectory in the file system from the root to the directory that the file is located in. The root directory is the top-most directory in the file system. Each subdirectory is separated by some delimiter. Windows systems use a backslash as a directory delimiter while the root directory is specified using a “volume” name such as C:\\. For example, an absolute path on a Windows system may look something like: C:\\applications\\users\\data\\data.txt On a Unix-based system, a forward slash is used as a directory delimiter and the root directory is simply a single forward slash. The same directory structure in a Unix-based system would look like the following. /applications/users/data/data.txt A path may also be relative to the current working directory. In most systems (Windows and Unix-based) the current directory is denoted using a single period, .."
Related Ideas
- How are files read, written, and properly managed?ComputerScienceOne · Paths
- How can you refer to directories and files at different levels of a directory tree?ComputerScienceOne · Error Handling
- How is the Linux file system organized?ComputerScienceOne · Error Handling
- When should data be stored in binary or text file format?ComputerScienceOne · Binary vs Text Files
- How do buffered and unbuffered file input/output differ?ComputerScienceOne · Buffered and Unbuffered