Skip to content

Tag: path

Check whether a path is absolute or relative

How do you check whether a path is absolute or relative, using C on Linux? Answer On Unix like systems (incl. Linux, macOS) If it starts with a slash it’s absolute, otherwise it’s relative. That is because everything is part of a single tree starting at the root (/) and file systems are mounted so…