您的位置:首页 > 运维架构 > Linux

linux c 下获取文件大小

2014-07-29 15:50 260 查看
635 /*
636 *       获取文件大小
637 */
638 int get_file_size(const char *filepath)
639 {
640         int filesize = 0;
641         struct stat statbuff;
642
643         if (stat(filepath, &statbuff) < 0) {
644                 return filesize;
645         } else {
646                 filesize = statbuff.st_size;
647         }
648
649         return filesize;
650 }
 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: