read file, return number of bytes read
| 106 | |
| 107 | // read file, return number of bytes read |
| 108 | size_t CDiskFile::Read(void *buf, size_t size) |
| 109 | { |
| 110 | // 0 bytes read if file is not open |
| 111 | if (!dfile) |
| 112 | return 0; |
| 113 | |
| 114 | // read/write change |
| 115 | if (lastop != 0) { |
| 116 | fseek(dfile, 0, SEEK_CUR); |
| 117 | lastop=0; |
| 118 | } |
| 119 | |
| 120 | // read the file |
| 121 | return fread(buf, 1, size, dfile); |
| 122 | } |
| 123 | |
| 124 | // write file, return number of bytes written |
| 125 | size_t CDiskFile::Write(void *buf, size_t size) |
no outgoing calls
no test coverage detected