Click to See Complete Forum and Search --> : is file open


remo
May 4th, 1999, 09:25 AM
hi
i have big problem with a simple thing

i can't check whether the file is open or not.

can somebody tell me translate the following questionmarks into c++ code. PLEASE HELP

thanks

in C

FILE * FpIn=NULL;
FpIn=fopen(FileName,"r");
if(FpIn!=NULL)
{
}


now in c++
ifstream InFile(FileName, ios::in);
if(?????????????????)
{
}

PeterK
May 4th, 1999, 04:01 PM
Although I do not use template for my file input and output files (I use CFile and CStdioFile) it appears there is a member of the ifstream template called is_open, check that.