文件夹副本跳过类似文件 [英] Folder Copy Skipping Similar Files

查看:84
本文介绍了文件夹副本跳过类似文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到很多递归复制文件夹的例子以及检查是否覆盖现有文件的选项(是/否)。



但是,我我无法找到任何这样的代码来检查现有文件并仅在以下情况下覆盖:



a。删除文件+文件夹(如果源目录中不存在)

b。如果文件大小不相似

c。如果这两个文件的日期各不相同



这在世界各地都有吗?



谢谢你可以在那里指导我。

I am seeing a lot of examples of folder recursively getting copied and an option to check whether to overwrite existing files (y/n).

However, I am unable top locate any such code which checks for existing files and overwrites only if :

a. Delete files + folders if not present in the source directory
b. if the file sizes are not similar
c. if the date of the two files vary

Is this present across the globe anywhere ?

Thanks if you can guide me there.

推荐答案

我认为你需要编写代码来手工完成。您可以使用Directory.GetFiles获取列表,使用FileInfo类来获取要比较的信息。
I think you need to write code to do this by hand. You can use Directory.GetFiles to get a list, and the FileInfo class for the info you want to compare.


这篇关于文件夹副本跳过类似文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆