Bug 16537 - dir.create() not warning if path can't be created
Summary: dir.create() not warning if path can't be created
Status: CLOSED FIXED
Alias: None
Product: R
Classification: Unclassified
Component: Misc (show other bugs)
Version: R 3.2.1
Hardware: Other Other
: P5 enhancement
Assignee: R-core
URL:
Depends on:
Blocks:
 
Reported: 2015-09-18 04:32 UTC by John Baumgartner
Modified: 2015-12-14 13:48 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Baumgartner 2015-09-18 04:32:35 UTC
For dir.create('foo/bar'), a warning is not issued if foo does not exist (and hence bar cannot be created without recursive=TRUE). 

Note that I receive appropriate warnings if I do:

> dir.create('foo/bar', recursive=T)
> dir.create('foo/bar')
Warning message:
In dir.create("foo/bar") : 'foo\bar' already exists


sessionInfo()

R version 3.2.1 (2015-06-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8 x64 (build 9200)

locale:
[1] LC_COLLATE=English_Australia.1252  LC_CTYPE=English_Australia.1252    LC_MONETARY=English_Australia.1252 LC_NUMERIC=C                      
[5] LC_TIME=English_Australia.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] tools_3.2.1
Comment 1 Duncan Murdoch 2015-09-18 09:32:08 UTC
I see this on Windows, but not on OSX.  It looks as though you were on Windows too. What version?
Comment 2 Duncan Murdoch 2015-09-18 10:58:48 UTC
Actually this affects all Windows versions:  in the Win32 part of the code, there was no attempt to give a warning.  I've fixed it and will soon commit to R-devel and R-patched.