dir.create {file} | R Documentation |
Trailing path separators are discarded. On Windows drives are allowed in
the path specification and unless the path is rooted, it will be interpreted
relative to the current directory on that drive. mode is ignored on Windows.
One of the idiosyncrasies of Windows Is that directory creation may report
success but create a directory with a different name, for example dir.create("G.S.")
creates '"G.S"’. This is undocumented, and what are the precise circumstances
is unknown (and might depend on the version of Windows). Also avoid directory
names with a trailing space.
dir.create(path,
showWarnings = TRUE,
recursive = FALSE,
mode = "0777");
There is no guarantee that these functions will handle Windows relative paths of the form ‘d:path’: try ‘d:./path’ instead. In particular, ‘d:’ is not recognized as a directory. Nor are \\?\ prefixes (and similar) supported. UTF-8-encoded dirnames Not valid in the current locale can be used.
dir.create and Sys.chmod return invisibly a logical vector indicating if the operation succeeded for each of the files attempted. Using a missing value for a path name will always be regarded as a failure. dir.create indicates failure if the directory already exists. If showWarnings = TRUE, dir.create will give a warning for an unexpected failure (e.g., not for a missing value nor for an already existing component for recursive = TRUE).