2012-02-16 192 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]; 
     };