2012-02-16 186 views

回答

1

我不认为增强提供了任何方式来查询文件系统类型。但是,您可能想为此使用statfs功能。从手册页 -

函数statfs()返回有关已装入文件系统的信息。路径是安装的文件系统中任何文件的路径名。 buf是指向statfs结构的指针,其大致定义如下:

 struct statfs { 
      __SWORD_TYPE f_type; /* type of file system (see below) */ 
      __SWORD_TYPE f_bsize; /* optimal transfer block size */ 
      fsblkcnt_t f_blocks; /* total data blocks in file system */ 
      fsblkcnt_t f_bfree; /* free blocks in fs */ 
      fsblkcnt_t f_bavail; /* free blocks available to 
             unprivileged user */ 
      fsfilcnt_t f_files; /* total file nodes in file system */ 
      fsfilcnt_t f_ffree; /* free file nodes in fs */ 
      fsid_t  f_fsid; /* file system id */ 
      __SWORD_TYPE f_namelen; /* maximum length of filenames */ 
      __SWORD_TYPE f_frsize; /* fragment size (since Linux 2.6) */ 
      __SWORD_TYPE f_spare[5]; 
     };