fix file mtime nil comparison, extract export_files_for_dir