long filesize( FILE *fp )
{
long int save_pos;
long size_of_file;
/* Save the current position. */
save_pos = ftell( fp );
/* Jump to the end of the file. */
fseek( fp, 0L, SEEK_END );
/* Get the end position. */
size_of_file = ftell( fp );
/* Jump back to the original position. */
fseek( fp, save_pos, SEEK_SET );
return( size_of_file );
}
时间: 2024-11-03 22:31:38