| 72 | } |
| 73 | |
| 74 | virtual Status Tell(uint64_t* pos) { |
| 75 | if (pos == NULL) { |
| 76 | return Status::InvalidArgument("invalid pos arg"); |
| 77 | } |
| 78 | int64_t ret = ftell(file_); |
| 79 | if (ret < 0) { |
| 80 | return Status::IOError("fail to ftell file", strerror(errno)); |
| 81 | } |
| 82 | *pos = (uint64_t)ret; |
| 83 | DEBUGLOG("tell file with pos %lld", ret); |
| 84 | return Status::OK(); |
| 85 | } |
| 86 | |
| 87 | virtual Status Seek(uint64_t pos) { |
| 88 | int32_t ret = fseek(file_, pos, SEEK_SET); |