Timeout in copy or move file VB6? -


I want to copy a file from folder to another folder, but for some time the source is not available or yet available , The source file is located on the network drive, so sometimes the network is slow or even the file is in use.

So I want to add the timeout parameter to the copy file command to avoid the "file not found" or any other error

Can not copy / move operations when the standard copy / move functionality created in the operating system will fail. Will be completed (for example, when the file was not found). There are several ways to open it from VB 6. You can make the built-in call, or you can use the FileSystemObject , which also contains CopyFile method Finally, you can either import or import a function from a Windows API Are and can call.

In any way you choose to go, you will simply write the error handling code which is the operation. If you want to avoid seeing this error in the user , you will swallow it in your code and your application will not be anything special.

I can not imagine how it would be useful. If the user is not aware of this then how can this problem determine?

As long as one time is over, there really is not much. As long as the operation is progressing normally, you can proceed with continuing with it. The same operating system data, at least even if it slows down (such as the file is on the network drive), until everything is alright, know it If there is only one error , it only stops if you really want to work, how long it takes strictly, even if it is ultimately successful or not, then you CopyFileEx will need to call the function, so you can cancel Running Copy Operation A VB6 sample is available. The sample hooks up a callback function which allows the function to report back its progress to your app. You or you may not need it; There is no need to be able to cancel the operation.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -