#356 Issue with multiple calls to open()/close() on File*Stream

closed
5
2012-09-14
2010-04-29
No

With the same Poco::FileInputStream object I
- open a first file, read data from it with std::getline(), close it
- open a second one and read data from it.

I get differences between Poco::FileInputStream and std::ifstream:
- with Poco::FileInputStream, I keep on reading line from the closed file until I reached its eof, then I can read data from the new file
- but with std::ifstream, I get the expected behavior

I have attached a sample code to reproduce this.

Calling seekg(0) after each call to open() fixes it.

Discussion

  • fixed in 1.3.7 rev. 1353