LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 738|回复: 1

用什么函数取磁盘信息?

[复制链接]
发表于 2004-2-18 16:48:32 | 显示全部楼层 |阅读模式
 楼主| 发表于 2004-2-19 20:40:26 | 显示全部楼层

硬盘文件系统信息已经解决

#include <sys/vfs.h>    /* or <sys/statfs.h> */

int statfs(const char *path, struct statfs *buf);


struct statfs {
                 long    f_type;     /* type of filesystem (see below) */
                 long    f_bsize;    /* optimal transfer block size */
                 long    f_blocks;   /* total data blocks in file system */
                 long    f_bfree;    /* free blocks in fs */
                 long    f_bavail;   /* free blocks avail to non-superuser */
                 long    f_files;    /* total file nodes in file system */
                 long    f_ffree;    /* free file nodes in fs */
                 fsid_t  f_fsid;     /* file system id */
                 long    f_namelen;  /* maximum length of filenames */
              };
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表