CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: is file open

  1. #1
    Join Date
    May 1999
    Posts
    12

    is file open

    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(?????????????????)
    {
    }





  2. #2
    Join Date
    May 1999
    Location
    Wisconsin, USA
    Posts
    953

    Re: is file open

    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.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured