[[arrow::export]]
| 263 | |
| 264 | // [[arrow::export]] |
| 265 | cpp11::writable::list fs___FileSystemFromUri(const std::string& path) { |
| 266 | using cpp11::literals::operator""_nm; |
| 267 | |
| 268 | #if defined(ARROW_R_WITH_S3) |
| 269 | // Initialize S3 before FileSystemFromUri so our options (with SIGPIPE handler) |
| 270 | // take effect before the C++ library's internal EnsureS3Initialized() call. |
| 271 | if (path.substr(0, 5) == "s3://") { |
| 272 | EnsureS3InitializedWithSigpipeHandler(); |
| 273 | } |
| 274 | #endif |
| 275 | |
| 276 | std::string out_path; |
| 277 | auto io_context = MainRThread::GetInstance().CancellableIOContext(); |
| 278 | return cpp11::writable::list({"fs"_nm = cpp11::to_r6(ValueOrStop( |
| 279 | fs::FileSystemFromUri(path, io_context, &out_path))), |
| 280 | "path"_nm = out_path}); |
| 281 | } |
| 282 | |
| 283 | // [[arrow::export]] |
| 284 | void fs___CopyFiles(const std::shared_ptr<fs::FileSystem>& source_fs, |
no test coverage detected