发布网友 发布时间:2022-05-21 08:07
共1个回答
热心网友 时间:2023-10-20 03:50
先用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;