Board index » cppbuilder » Validating a UNC path?
Mike K
![]() CBuilder Developer |
Validating a UNC path?2007-03-18 10:48:39 PM cppbuilder37 Anyone know how to determine at runtime if a UNC path spec is currently valid? My app is sleeping for up to a minute trying to find a folder in a UNC path that points to a volume that is offline. I'm using DirectoryExists() for this, and this function works fine for local volumes, but IF its pathspec is UNC and IF the target volume is not on the network at the moment, this function takes a minute or two to time out, and the rest of the app is waiting to execute until this function returns. DirectoryExists() works fine for valid UNC paths: String logpath; logpath = "C:\\log_files\\"; if(DirectoryExists(logpath))OpenLogFile(); // this is no problem logpath = "\\\\FILESERV\\logs\\"; if(DirectoryExists(logpath))OpenLogFile(); If FILESERV is offline, this function has to timeout before control is passed back to your app. Is there some alternative to DirectoryExists()? |