Hadley Wickham
2018-Mar-29 21:23 UTC
[Rd] Base R examples that write to current working directory
Hi all, Given the recent CRAN push to prevent examples writing to the working directory, is there any interest in fixing base R examples that write to the working directory? A few candidates are the graphics devices, file.create(), writeBin(), writeChar(), write(), and saveRDS(). I'm sure there are many more. One way to catch these naughty examples would be to search for unlink() in examples: e.g., https://github.com/wch/r-source/search?utf8=?&q=unlink+extension%3ARd&type=. Of course, simply cleaning up after yourself is not sufficient because if those files existed before the examples were run, the examples will destroy them. Hadley -- http://hadley.nz
Duncan Murdoch
2018-Mar-29 22:08 UTC
[Rd] Base R examples that write to current working directory
On 29/03/2018 5:23 PM, Hadley Wickham wrote:> Hi all, > > Given the recent CRAN push to prevent examples writing to the working > directory, is there any interest in fixing base R examples that write > to the working directory? A few candidates are the graphics devices, > file.create(), writeBin(), writeChar(), write(), and saveRDS(). I'm > sure there are many more. > > One way to catch these naughty examples would be to search for > unlink() in examples: e.g., > https://github.com/wch/r-source/search?utf8=?&q=unlink+extension%3ARd&type=. > Of course, simply cleaning up after yourself is not sufficient because > if those files existed before the examples were run, the examples will > destroy them. >Why not put together a patch that fixes these? This doesn't seem to be something that needs discussion, fixing the bad examples would be a good idea. Duncan Murdoch
Uwe Ligges
2018-Mar-30 16:25 UTC
[Rd] Base R examples that write to current working directory
On 30.03.2018 00:08, Duncan Murdoch wrote:> On 29/03/2018 5:23 PM, Hadley Wickham wrote: >> Hi all, >> >> Given the recent CRAN push to prevent examples writing to the working >> directory, is there any interest in fixing base R examples that write >> to the working directory? A few candidates are the graphics devices, >> file.create(), writeBin(), writeChar(), write(), and saveRDS(). I'm >> sure there are many more. >> >> One way to catch these naughty examples would be to search for >> unlink() in examples: e.g., >> https://github.com/wch/r-source/search?utf8=?&q=unlink+extension%3ARd&type=. >> >> Of course, simply cleaning up after yourself is not sufficient because >> if those files existed before the examples were run, the examples will >> destroy them. >> > > Why not put together a patch that fixes these?? This doesn't seem to be > something that needs discussion, fixing the bad examples would be a good > idea.Seconded. CRAN would not accept these base packages, hence we should urgently give better examples. Best, Uwe> Duncan Murdoch > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel
Reasonably Related Threads
- Base R examples that write to current working directory
- Base R examples that write to current working directory
- Base R examples that write to current working directory
- Base R examples that write to current working directory
- How to write the bytes 00 01 00 to a file/connection?