码迷,mamicode.com
首页 > 其他好文 > 详细

获取文件大小的函数

时间:2016-04-07 10:51:56      阅读:131      评论:0      收藏:0      [点我收藏+]

标签:

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

获取文件大小的函数

标签:

原文地址:http://www.cnblogs.com/xuandi/p/5362405.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!