| 69 | // Note: only one of the Open* methods below may be called on a given instance |
| 70 | |
| 71 | Status OpenWritable(const std::string& path, bool truncate, bool append, |
| 72 | bool write_only) { |
| 73 | RETURN_NOT_OK(SetFileName(path)); |
| 74 | |
| 75 | ARROW_ASSIGN_OR_RAISE(fd_, ::arrow::internal::FileOpenWritable(file_name_, write_only, |
| 76 | truncate, append)); |
| 77 | mode_ = write_only ? FileMode::WRITE : FileMode::READWRITE; |
| 78 | |
| 79 | if (!truncate) { |
| 80 | ARROW_ASSIGN_OR_RAISE(size_, ::arrow::internal::FileGetSize(fd_.fd())); |
| 81 | } else { |
| 82 | size_ = 0; |
| 83 | } |
| 84 | return Status::OK(); |
| 85 | } |
| 86 | |
| 87 | // This is different from OpenWritable(string, ...) in that it doesn't |
| 88 | // truncate nor mandate a seekable file |
no test coverage detected