Copy file and maybe copy stats. fix #349