| 763 | } |
| 764 | |
| 765 | Status MockFileSystem::CreateFile(const std::string& path, std::string_view contents, |
| 766 | bool recursive) { |
| 767 | RETURN_NOT_OK(ValidatePath(path)); |
| 768 | auto parent = fs::internal::GetAbstractPathParent(path).first; |
| 769 | |
| 770 | if (parent != "") { |
| 771 | RETURN_NOT_OK(CreateDir(parent, recursive)); |
| 772 | } |
| 773 | |
| 774 | ARROW_ASSIGN_OR_RAISE(auto file, OpenOutputStream(path)); |
| 775 | RETURN_NOT_OK(file->Write(contents)); |
| 776 | return file->Close(); |
| 777 | } |
| 778 | |
| 779 | Result<std::shared_ptr<FileSystem>> MockFileSystem::Make( |
| 780 | TimePoint current_time, const std::vector<FileInfo>& infos) { |
no test coverage detected