#include <sys/stat.h>
unsigned long get_file_size(const char
*path)
{
unsigned long filesize = -1;
struct stat
statbuff;
if(stat(path, &statbuff) < 0){
return filesize;
}else{
filesize = statbuff.st_size;
}
return
filesize;
}
原文:http://www.cnblogs.com/xf-linux-arm-java-android/p/3674694.html