Create file and rename the file at the end.