improve hdfsopenfile function