如何从hadoop的Hdfs上查询文件?
先用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;
标签:hadoop,Hdfs,查询