replace_file_start: Now takes a file handle instead of a file name