I've been looking for a way to get the current working directory without using getcwd
. The reason being that the return from this function is mutable by chdir
. Additionally because of this I suspect that getcwd
is a blocking function.
I don't mind if the solution is blocking, just so long as it is immutable (and thusly cachable) and callable from anywhere (i.e. no bootstrapping). It needs to always be the directory from which the process was executed.