一次复制1000个文件 [英] copy 1000 file at one time

查看:111
本文介绍了一次复制1000个文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想复制1000或更多 - 到30或40或更多文件夹 

I want to copy 1000 and more -- to 30 or 40 or more folders 

我正在尝试 foreach  并且它非常慢

I'm try foreach  and it's very slow

如果有任何想法将文件夹中的所有文件复制到另一个40文件夹

if there any idea to copy all files in folder to another 40 folder

Dev M.Basha

Dev M.Basha

推荐答案


我想要复制1000或更多 - 到30或40或更多文件夹 

I want to copy 1000 and more -- to 30 or 40 or more folders 

我正在尝试 foreach  而且非常慢

是什么让你觉得它是"慢"的而不仅仅是"忙碌"?b
$
需要多长时间?你认为应该花多长时间?你当时到达的是多少b $ b?也许只是一厢情愿的想法?
b
$
复制设备的速度是多少?
b $ b你有没有把时间安排在一个更快的设备,例如SSD?
$


你在这个foreach循环中做了什么*确切*?一个
的foreach循环本身通常会比你眨眼的速度快。



你有没有比较你花费的时间程序将这些1000 +

文件复制到使用Windows实用程序(如Windows $
资源管理器,Total Commander或xcopy等)复制它们所需的时间? br />


请注意,当您说"一次复制1000个文件"时这听起来像你b $ b试图同时进行文件复制。如果是这样,那可能比连续一次复制一个文件慢一些b
。在
a硬盘驱动器,软盘等上同时复制会导致头部执行器移动过多,从而增加延迟(旋转延迟)和降低效率。 b $ b读/写缓存,预取等。



- Wayne

What makes you think it's "slow" as opposed to just being "busy"?

How long does it take? How long do you think it should take? How did
you arrive at that time? Just wishful thinking perhaps?

What is the speed of the device on which the copies are being done?
Have you timed it on a faster device, such as an SSD?

What *exactly* are you doing in this foreach loop? A foreach loop in
and of itself usually will be faster than you can blink an eye.

Have you compared the time it takes your program to copy these 1000+
files to the time it takes to copy them using a utility such as Windows
Explorer, or Total Commander, or xcopy, etc.?

Note that when you say "copy 1000 file at one time" it sounds like you
are trying to do simultaneous file copying. If so, that can be slower
than copying files one at a time consecutively. Concurrent copying on
a hard drive, floppy, etc. can result in excessive head actuator movement
as well as increased latency (rotational delays) and reduced effectiveness
of read/write caching, prefetching, etc.

- Wayne

这篇关于一次复制1000个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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