copy or transcode to a temp file, then move it to the final name when done.  ensure rm the tmp file if there is an exception
flatten __+