Working with fstream objects