Learning file opening and writing