Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CopyFile() takes consadirable time if destenition server is down

Status
Not open for further replies.

lyoka

Programmer
Aug 20, 2002
1
IL
I use Visual Studio 6 C++. For copy files to remote server(Windows 2000 Server) I call Win32 API function CopyFile(). If the destenition server is OK or does not exist in network CopyFile() returns immediatly. But if the server is defined (for example in active directory)but does not work at the moment CopyFile() "thinks" aproximatly 30 sec. befor fails.
I can't find in MSDN API to make something as ping or force CopyFile() to return more quikly.
I hope that my question is clear despite my terriable English.
Thanks Oleg.
 
You might want to take a look at the CopyFileEx API. This function has a callback capability as portions of the file are copied, with the ability to cancel the operation. I don't know, but it may be that the callback will be called sooner giving you the chance to see that things are working quite right and you have the chance to cancel. This API also has a restart capability for cases when the network fails in the middle of the copy. Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top