! * \brief fnbytesInFile() * * \param[in] fp file stream * \return nbytes in file; 0 on error */
| 1430 | * \return nbytes in file; 0 on error |
| 1431 | */ |
| 1432 | size_t |
| 1433 | fnbytesInFile(FILE *fp) |
| 1434 | { |
| 1435 | l_int64 pos, nbytes; |
| 1436 | |
| 1437 | PROCNAME("fnbytesInFile"); |
| 1438 | |
| 1439 | if (!fp) |
| 1440 | return ERROR_INT("stream not open", procName, 0); |
| 1441 | |
| 1442 | pos = ftell(fp); /* initial position */ |
| 1443 | fseek(fp, 0, SEEK_END); /* EOF */ |
| 1444 | nbytes = ftell(fp); |
| 1445 | fseek(fp, pos, SEEK_SET); /* back to initial position */ |
| 1446 | return nbytes; |
| 1447 | } |
| 1448 | |
| 1449 | |
| 1450 | /*--------------------------------------------------------------------* |
no outgoing calls
no test coverage detected