- A character string: tilde expansion will be done.
getwd returns a character string or
NULL if the working directory is not available. On Windows the path returned will use
/ as the path separator and be encoded in UTF-8. The path will not have a trailing
/ unless it is the root directory (of a drive or share on Windows).
Note that the return value is said to be an absolute filepath: there can be more than one representation of the path to a directory and on some OSes the value returned can differ after changing directories and changing back to the same directory (for example if symbolic links have been traversed).
Documentation reproduced from R 3.0.2. License: GPL-2.