File::exists() wrong result
Expected behavior
if the file does not exists return false, true if exists
Actual behavior
Sometimes happens to me that for some network files (accessed like \IP\folder\file.txt) function seems to return false even if the file exists. I think the problem is (under windows) the function existsImpl() return false if ERROR_NOT_READY. I have to investigate more on that. If happens the NOT READY could be not permanent but temporary situation
POCO version
1.9.0
Compiler and version
Visual studio 2015
Operating system and version
Window 10
Other relevant information
using network drive with network uri
I don't know if it's better to leave the ERROR_NOT_READY out switch
Strictly speaking, that falls into a "grey zone" of network share existing, file possibly being there, but we can't tell one way or the other - exceptional circumstances. One could also argue that, for practical purposes, at the time of function call the file exists or not equally as any file at any unaccessible location. But, yes - exception would provide more accurate information than returning false.
the problem is that you could create a new file, clearing existing one, because you get false or you could leave a file that you must delete but you think is not there. anyway you are right it's some kind of grey zone
I say, move it to exception. @obiltschnig
This issue is stale because it has been open for 365 days with no activity.
This issue is stale because it has been open for 365 days with no activity.