windows - Handling possible errors with network drive file I/O -


I'm trying to create a file I / O on a network drive as possibly a trust (possibly a WAN or VPN) for the original C ++ Windows app ...

What are the possible error conditions that I should be able to handle?

How can I imitate these error conditions in the trial?

How do I get detailed information on a particular error? For example, if fopen () fails, errno let me know what I need to know, or GetLastError () value?

How do I differentiate between different problems with "Network drive is fully functional but file does not exist" and with network or server?

A special error condition that I noticed on my desktop (which is not specific to the app developed) is that sometimes the first attempt to access the file on the network drive will fail, But perhaps the reason for the drive is to reconnect in the background, because I do not know what the reason for the latter connection is, it is an example of an error condition that I can not properly Bengal would like to.

Edit: This legacy is for distributed apps that uses files on network shares for communication between nodes. Some nodes may be unattainable, so sending the error to the end user can not be an option. The long-term goal is to switch to a better protocol, but in the short term I would like to make file I / O as reliable as possible.

I believe you are reaching it from a wrong perspective. Basically there is a network file system driver problem, in addition to implementing the network I / O, there is little to be said in applying to improve it, you can find a suitable for your needs Network file system should be better than choosing. See on Wikipedia.

Generally, your app should behave like a locally stored file. Do not work hard to handle network issues, but if you have a good network file system choice, these problems can be automatically reduced.

So I would say that in case of errors you is not wrong Perhaps fallback on local storage fails in writing a remote file (if the network file system does not handle itself ).


Comments