get the file size
| 188 | |
| 189 | // get the file size |
| 190 | long CDiskFile::GetSize() |
| 191 | { |
| 192 | // default result |
| 193 | long res=0; |
| 194 | |
| 195 | // return default result if file is not open |
| 196 | if (!dfile) |
| 197 | return res; |
| 198 | |
| 199 | // get the current file position, stop on error |
| 200 | long pos=ftell(dfile); |
| 201 | if (pos < 0) |
| 202 | return res; |
| 203 | |
| 204 | // get the file size |
| 205 | long size=Seek(0, End); |
| 206 | |
| 207 | // restore file position, stop on error |
| 208 | if (Seek(pos, Position) != pos) |
| 209 | return res; |
| 210 | |
| 211 | return size; |
| 212 | } |
| 213 | |
| 214 | // get file position |
| 215 | long CDiskFile::GetPosition() |
no outgoing calls
no test coverage detected