'Is it well defined or predictable to pass a relative path to fopen()?
On most systems, passing a name with no preceding path opens the path relative to the current working directory. However, how reliable is this practice, compared to, for example, always using an absolute path and prepending the result of getenv("HOME") or getpwuid(getuid()) (see Get home directory in Linux). Which practice is more standard or reliable or recommended? It is certainly simpler to use the relative path with no preceding /, as there is no allocating memory to concatenate strings, but what are the downsides to this practice over manually concatenating the absolute path of the home directory?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
