-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DESCRIPTION on mounted folders #495
Comments
I did some more checking with for(i in 1:10){cat(i, file = "/mounted/folder/test2", append = TRUE)}
|
This is a bug with R — can you please report on R-devel? |
Nope. (r-devel sent him to r-sig-debian where I just conjectured that R has nothing to do with this. The 'append' property is not being honoured by the I would suggest to work around it. Create the DESCRIPTION file somewhere else -- say in |
you can change the roxygen2:::write.description as above and it works fine. I created a file named .Rprofile in the package root folder (which is the working directory for the R process) with the following content: .First <- function() {
requireNamespace("roxygen2")
unlockBinding("write.description", asNamespace("roxygen2"))
assign(
"write.description",
function(desc, file = "") {
con <- if(file != "") file(file, "w") else ""
mapply(roxygen2:::cat.description, names(desc), desc, MoreArgs = list(file = con))
if(con != "") close(con)
invisible()
},
envir = asNamespace("roxygen2")
)
lockBinding("write.description", asNamespace("roxygen2"))
} |
This will not work in the future because |
Situation:
Ubuntu 16.04, latest R and roxygen2 from CRAN and a Package in a folder mounted with sftp via gnome virtual file system
A call to
roxygen2::document()
produces a garbageDESCRIPTION
file: instead of appending it overwrites from the beginning. The problem is R and writing to connectionsgives a file that reads
10
and not1 2 ... 10
Solution, open the file only once:
The post that helped me with this can be found here:
https://stackoverflow.com/questions/24927041/r-writeappend-true-overwrites-file-contents
The text was updated successfully, but these errors were encountered: