IsOpen
Check file object is open or not, when use a method of File object which is not open will lead a runtime error. Use this function before you call the method of File object.
BOOL IsOpen( )
True of success, else false
EX1
//This function opens/creates the file c:\test.txt. void file_IsOpen_ex1() { file ff; BOOL bOK; string strFile = "C:\\test.txt"; bOK = ff.Open(strFile, file::modeCreate | file::modeWrite); //create a new write only file and open it if(!bOK) out_str("failed to open the file"); else { if( ff.IsOpen() ) { printf("The ff file is open"); //The string should be output ff.Close(); //Close the ff file } } }
origin.h