| 25 | // Demonstrate dynamically loading a user-defined Arrow FileSystem |
| 26 | |
| 27 | arrow::Status Execute() { |
| 28 | ARROW_RETURN_NOT_OK(arrow::fs::LoadFileSystemFactories(FILESYSTEM_EXAMPLE_LIBPATH)); |
| 29 | |
| 30 | std::string uri = "example:///example_file"; |
| 31 | std::cout << "Uri: " << uri << std::endl; |
| 32 | |
| 33 | std::string path; |
| 34 | ARROW_ASSIGN_OR_RAISE(auto fs, arrow::fs::FileSystemFromUri(uri, &path)); |
| 35 | std::cout << "Path: " << path << std::endl; |
| 36 | |
| 37 | fs::FileSelector sel; |
| 38 | sel.base_dir = "/"; |
| 39 | ARROW_ASSIGN_OR_RAISE(auto infos, fs->GetFileInfo(sel)); |
| 40 | |
| 41 | std::cout << "Root directory contains:" << std::endl; |
| 42 | for (const auto& info : infos) { |
| 43 | std::cout << "- " << info << std::endl; |
| 44 | } |
| 45 | return arrow::Status::OK(); |
| 46 | } |
| 47 | |
| 48 | int main() { |
| 49 | auto status = Execute(); |
no test coverage detected