I have not tested this code, but I am wondering if FIFO just sets the EOF bit when you read all the available data. In this case, you could do this:
std::ifstream fifo;
std::string line;
bool done = false;
while (!done)
{
while (std::getline(fifo, line))
{
}
if (fifo.eof())
{
fifo.clear();
}
else
{
done = true;
}
}
FIFO, reset . , . -. , FIFO , reset.