ralph
7/22/2011 8:20:00 PM
On Fri, 22 Jul 2011 09:13:49 -0700, BeeJ <nospam@live.com> wrote:
>I am copying several thousand files and keeping the date/time of the
>source at the destination.
>On maybe one out of 1000 files the set file date time fails.
>Using the APIs to get and set date/time.
>This all works on the other 999 of 1000 files copied.
>So I built in a test and loop up to ten times with a 10 mSec wait on
>each attempts. This still fails for some but for others it works. The
>file in question attributes are normal only.
>However, when I break the code in the IDE and manually step through the
>date/time successfully changes every time. In my test case, the files
>are going to a network share.
>
>What is going on here?
>What can I do to fix this?
>
A bulk multiple file copy while also touching them in the process is
often problematic across a wire. Resources (file locks, handles, etc.)
have become all most 'unlimited' with modern computing - but we ain't
there yet. <g>
Timing and rearrangment is always the solution, but difficult to
recommend anything, without seeing how you are going about it. Post
either the actual code (best) or in rough psuedocode, what it is you
are trying to do.
-ralph