| 90 | } |
| 91 | |
| 92 | Status Seek(int64_t position, int whence) { |
| 93 | RETURN_NOT_OK(CheckClosed()); |
| 94 | |
| 95 | // NOTE: `long long` is at least 64 bits in the C standard, the cast below is |
| 96 | // therefore safe. |
| 97 | |
| 98 | // whence: 0 for relative to start of file, 2 for end of file |
| 99 | PyObject* result = cpp_PyObject_CallMethod(file_.obj(), "seek", "(Li)", |
| 100 | static_cast<long long>(position), whence); |
| 101 | Py_XDECREF(result); |
| 102 | PY_RETURN_IF_ERROR(StatusCode::IOError); |
| 103 | return Status::OK(); |
| 104 | } |
| 105 | |
| 106 | Status Read(int64_t nbytes, PyObject** out) { |
| 107 | RETURN_NOT_OK(CheckClosed()); |
nothing calls this directly
no test coverage detected