ENH: make cwd() behaviour user-adjustable (issue #1007)
- with the 'cwd' optimization switch it is possible to select the preferred behaviour for the cwd() function. A value of 0 causes cwd() to return the physical directory, which is what getcwd() and `pwd -P` return. Until now, this was always the standard behaviour. With a value of 1, cwd() instead returns the logical directory, which what $PWD contains and `pwd -L` returns. If any of the sanity checks fail (eg, PWD points to something other than ".", etc), a warning is emitted and the physical cwd() is returned instead. Apart from the optical difference in the output, this additional control helps workaround file systems with whitespace or other characters in the directory that normally cause OpenFOAM to balk. Using a cleaner symlink elsewhere should skirt this issue. Eg, cd $HOME ln -s "/mounted volume/user/workdir" workdir cd workdir # start working with OpenFOAM
Showing
- applications/test/POSIX/Test-POSIX.C 5 additions, 1 deletionapplications/test/POSIX/Test-POSIX.C
- etc/controlDict 3 additions, 0 deletionsetc/controlDict
- src/OSspecific/POSIX/POSIX.C 88 additions, 3 deletionssrc/OSspecific/POSIX/POSIX.C
- src/OSspecific/POSIX/fileStat.C 15 additions, 4 deletionssrc/OSspecific/POSIX/fileStat.C
- src/OSspecific/POSIX/fileStat.H 20 additions, 8 deletionssrc/OSspecific/POSIX/fileStat.H
- src/OpenFOAM/include/OSspecific.H 9 additions, 1 deletionsrc/OpenFOAM/include/OSspecific.H
Please register or sign in to comment