| 200 | #endif |
| 201 | |
| 202 | void init_fp(const char * mode) { |
| 203 | fp = ggml_fopen(fname.c_str(), mode); |
| 204 | if (fp == NULL) { |
| 205 | throw std::runtime_error(format("failed to open %s: %s", fname.c_str(), strerror(errno))); |
| 206 | } |
| 207 | seek(0, SEEK_END); |
| 208 | size = tell(); |
| 209 | seek(0, SEEK_SET); |
| 210 | } |
| 211 | |
| 212 | size_t tell() const { |
| 213 | if (fd == -1) { |
nothing calls this directly
no test coverage detected