| Class | Dir |
| In: |
src/ruby_supportlib/phusion_passenger/ruby_core_enhancements.rb
|
| Parent: | Object |
The current working directory may contain one or more symlinks in its path. Both Dir.pwd and the C getcwd() call resolve symlinks in the path.
It turns out that there is no such thing as a path without unresolved symlinks. The shell presents a working directory with unresolved symlinks (which it calls the "logical working directory"), but that is an illusion provided by the shell. The shell reports the logical working directory though the PWD environment variable.
This method tries to use the PWD environment variable if it matches the actual working directory.
See also: github.com/phusion/passenger/issues/1596#issuecomment-138154045 git.savannah.gnu.org/cgit/coreutils.git/tree/src/pwd.c www.opensource.apple.com/source/shell_cmds/shell_cmds-170/pwd/pwd.c