Remove a file (call back into R for this)
| 2998 | |
| 2999 | // Remove a file (call back into R for this) |
| 3000 | bool removeFile(const std::string& path) { |
| 3001 | if (FileInfo(path).exists()) { |
| 3002 | Rcpp::Function rm = Rcpp::Environment::base_env()["file.remove"]; // #nocov start |
| 3003 | rm(path); |
| 3004 | return true; // #nocov end |
| 3005 | } |
| 3006 | else { |
| 3007 | return false; |
| 3008 | } |
| 3009 | } |
| 3010 | |
| 3011 | // Recursively create a directory (call back into R for this) |
| 3012 | void createDirectory(const std::string& path) { // #nocov start |