basic_fstream::is_open

Test to ensure basic_fstream file is open and available for reading or writing.

  bool is_open() const
  
Remarks

Use the function is_open() for a basic_fstream file to ensure it is open before attempting to do any input or output operation on a file.

Returns true if a file is available and open.

See Also

For an example, see Example of basic_fstream:: basic_fstream() usage.