do_export(): check if file exists