rename stat function to getFileInfo according to review feedback