linux c/c 获取文件大小
#include
int filesize(const char* fname)
{
struct stat statbuf;
if(stat(fname,&statbuf)==0)
return statbuf.st_size;
return -1;
}
#include
int filesize(const char* fname)
{
struct stat statbuf;
if(stat(fname,&statbuf)==0)
return statbuf.st_size;
return -1;
}