How to poll a file using STL?!?!
Hi all! I'm having difficulties polling for a file to exist cq. get opened... the code is simillar to:
std::ifstream lv_InFile;
lv_InFile.open("blabla");
while (!lv_InFile.is_open() && nTimeOut--)
{
Sleep(1000);
lv_InFile.open("blabla");
}
if (!lv_InFile.is_open())
return false;
It only sees the file if it's there from the beginning, not if it gets copied somewhere during nTimeOut seconds?
Does anyone know of a neat algorithm to poll for a file using STL? Thanks in advance!