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 );
}

相关文章:

  • 2021-09-22
  • 2021-10-08
  • 2022-02-10
  • 2021-12-12
  • 2021-09-25
  • 2021-08-09
猜你喜欢
  • 2022-12-23
  • 2021-05-28
  • 2021-09-04
  • 2022-12-23
  • 2022-12-23
  • 2021-12-08
  • 2021-08-12
相关资源
相似解决方案