| 269 | } |
| 270 | |
| 271 | Result<int64_t> PyReadableFile::GetSize() { |
| 272 | return SafeCallIntoPython([=]() -> Result<int64_t> { |
| 273 | ARROW_ASSIGN_OR_RAISE(int64_t current_position, file_->Tell()); |
| 274 | RETURN_NOT_OK(file_->Seek(0, 2)); |
| 275 | |
| 276 | ARROW_ASSIGN_OR_RAISE(int64_t file_size, file_->Tell()); |
| 277 | // Restore previous file position |
| 278 | RETURN_NOT_OK(file_->Seek(current_position, 0)); |
| 279 | |
| 280 | return file_size; |
| 281 | }); |
| 282 | } |
| 283 | |
| 284 | // ---------------------------------------------------------------------- |
| 285 | // Output stream |
nothing calls this directly
no test coverage detected