File.Copy causes 'The semaphore timeout period has expired.' error

  • Thread starter Thread starter Jeremy Chapman
  • Start date Start date
J

Jeremy Chapman

I've got a recursive function that copies all files/folders to a new
location. On one file, which is about a meg, it gives me an error
The semaphore timeout period has expired.

This occures on a File.Copy what causes this?
 
are you on WAN link ? or a slow speed/cloged/congested network ? It seems
that the filecopy retrial timout limit is being reached & hence the error

Manasvin
 
I figured it out. It happens when the total path length of the source file
and the total path length of the destination file are greater than a given
value, 128 I believe. When this occures in windows, it results in a Path
Too Deep error.

Arrg! So instead of just copying it directly, I first copy it to my hard
drive c:\a.tmp, then copy it to the final destination with the correct file
name.
 
Back
Top