Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2024-11-25 Simon Guest <[email protected]>
* src/attributes.cpp: fix CPP source having to be writable

2024-11-03 Marco Colombo <[email protected]>

* vignettes/rmd/Rcpp-FAQ.Rmd: Fixed typos
Expand Down
2 changes: 1 addition & 1 deletion src/attributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3279,7 +3279,7 @@ namespace {

// copy the source file to the build dir
Rcpp::Function filecopy = Rcpp::Environment::base_env()["file.copy"];
filecopy(cppSourcePath_, generatedCppSourcePath(), true);
filecopy(cppSourcePath_, generatedCppSourcePath(), true, Rcpp::_["copy.mode"] = false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. I'll look some more at that tomorrow over morning coffee -- this ensures we get 0644 irrespective of original permissionss?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have by now caught up onto help(file.copy) -- this is perfect. Had worried that this code, because it dates back to before we had filesystem semantics from C++17 and all that, would have to do dance to do this portably. But farming out to a call to then underlying R instance we always have is golden, and that function has that option. Very nice.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I generally have a mild dislike of Rcpp::_[...] over the preferred Rcpp::Named("...") but they are equivalent, and the former is used in the file already. So may change that another time....


// parse attributes
SourceFileAttributesParser sourceAttributes(cppSourcePath_, "", true);
Expand Down