correctly writes to nonexistent file