先用hdfsgetpathinfo得到一個hdfsfileinfo型別的結構體,
get_real_path(dsh,s,real_path);
hdfsfileinfo*pt_hdfs_file_info=hdfsgetpathinfo(hdfs,real_path);//
這個結構體中有個kind屬性,就是來區分是檔案還是目錄
typedefstruct{
tobjectkindmkind;/*fileordirectory*/
char*mname;/*thenameofthefile*/
ttimemlastmod;/*thelastmodificationtimeforthefileinseconds*/
toffsetmsize;/*thesizeofthefileinbytes*/
shortmreplication;/*thecountofreplicas*/
toffsetmblocksize;/*theblocksizeforthefile*/
char*mowner;/*theownerofthefile*/
char*mgroup;/*thegroupassociatedwiththefile*/
shortmpermissions;/*thepermissionsassociatedwiththefile*/
ttimemlastaccess;/*thelastaccesstimeforthefileinseconds*/
}hdfsfileinfo;
先用hdfsgetpathinfo得到一個hdfsfileinfo型別的結構體,
get_real_path(dsh,s,real_path);
hdfsfileinfo*pt_hdfs_file_info=hdfsgetpathinfo(hdfs,real_path);//
這個結構體中有個kind屬性,就是來區分是檔案還是目錄
typedefstruct{
tobjectkindmkind;/*fileordirectory*/
char*mname;/*thenameofthefile*/
ttimemlastmod;/*thelastmodificationtimeforthefileinseconds*/
toffsetmsize;/*thesizeofthefileinbytes*/
shortmreplication;/*thecountofreplicas*/
toffsetmblocksize;/*theblocksizeforthefile*/
char*mowner;/*theownerofthefile*/
char*mgroup;/*thegroupassociatedwiththefile*/
shortmpermissions;/*thepermissionsassociatedwiththefile*/
ttimemlastaccess;/*thelastaccesstimeforthefileinseconds*/
}hdfsfileinfo;