How to read all data stored in a file