title: How can I ensure fopen() won't block when not connected to the network?
body: <p>My win32 C++ application frequently checks a file that normally resides on a network share [in our corporate network]. But if the computer isn't connected to a network, the application freezes for several minutes and the user usually has to end the process. How can I check if the file is accessible before I open it?</p>
  
  <p>Checking if any network connection exists may not be good enough. The reason the users disconnect is to use to a test network where the file does not exist.</p>