Opening and writing to file with default content