simulate the behavior of original fs.readFile