获取文件大小代码(C语言)

2014-11-23 21:38:10 · 作者: · 浏览: 18
long MyGetFileSize( const char* pFile )
{
struct _stat buf;
int result;
result = _stat( pFile, &buf );
if( result != 0 )
{
return -1;
} else {
return buf.st_size;
}
}