Using tempnam to generate destination format file to avoid race conditions.