cppreference.com > C++ I/O > rdstate
rdstate
Syntax:
  #include <fstream>
  iostate rdstate();

The rdstate() function returns the io stream state flags of the current stream.