PathFileExists() and GetFileAttributes() both hang when a network path doesn't exist.
-
I'm trying to verify that a path exists by using either PathFileExists() or GetFileAttributes(), but when a network path like \\SWAP01\slave02\mydirectory doesn't exist because the system isn't on, both functions hang. In fact, they hang pretty seriously, so much so that I can't kill the process from the debugger OR the task manager. My only option appears to be to log off from the system and log back in. Any thoughts on how I might better deal with this hang?
-
I'm trying to verify that a path exists by using either PathFileExists() or GetFileAttributes(), but when a network path like \\SWAP01\slave02\mydirectory doesn't exist because the system isn't on, both functions hang. In fact, they hang pretty seriously, so much so that I can't kill the process from the debugger OR the task manager. My only option appears to be to log off from the system and log back in. Any thoughts on how I might better deal with this hang?
TragicComic wrote:
Any thoughts on how I might better deal with this hang?
Have you tried
_access()
? It's a wrapper aroundGetFileAttributes()
so it may not be any better. If you are using MFC, check outCFile::GetStatus()
."Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch