获取文件大小函数
来源:互联网 发布:人人商城数据库表 编辑:程序博客网 时间:2024/06/03 19:39
方法一:
long filesize( char * pFileName )
{
long int save_pos;
long size_of_file;
FILE * fp = fopen( pFileName ,"r+b" );
/* 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 );
fclose(fp);
return( size_of_file );
}
方法二:
#include <io.h>
long filelen( char * pFileName )
{
FILE * f = fopen( pFileName , "r+b");
int handle = fileno(f) ;
long nlen = filelength( handle );
fclose(f);
return nlen;
}
- 获取文件大小函数
- Linux 获取文件大小--C函数
- Linux 获取文件大小--C函数
- linux获取文件大小的函数
- Linux 获取文件大小--C函数
- php获取文件大小封装函数
- 用文件大小获取单位的函数[asp]
- 转--C函数获取文件大小【待用】
- C语言中获取文件大小的函数
- Linux下获取文件大小,检索目录函数
- Linux下获取文件大小,检索目录函数
- linux 使用lseek函数来获取文件大小
- 获取文件大小
- 获取文件大小
- 获取文件大小
- 获取文件大小
- 获取文件大小
- 获取文件大小
- 网络攻击技术与攻击工具六大趋势
- CopyU!v2 BETA2已发布!
- firefox市场流失之我见
- linux code format tool indent
- windows dos命令失效
- 获取文件大小函数
- 常用windbg命令
- Spring配置文件总结
- spring aop笔记(使用demo)
- windows 下ruby1.9.2、Rails3.0.9安装和配置
- Spring依赖注入
- 在 C# 中通过 P/Invoke 调用Win32 DLL
- Android中通过getSystemService取得服务
- 理解和使用Linux的硬件抽象层HAL