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

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?
 
M

Manasvin

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
 
J

Jeremy Chapman

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top