In C/Linux program How to open microsoft office outlook configurationfile

Discussion in 'C Programming' started by Lakshmi Sreekanth, May 20, 2010.

  1. Hi All,

    I am trying to open a Microsoft office outlook configuration file. But
    I am not be able to open that file. The name of the file: PMST.

    I'm getting this error:
    #ERROR# File :/PERM/PLAIN/PMST cannot be opened
    #ERROR# FILE:/PERM/PLAIN/PMST does not exists in the device

    Pls tell me whether we need to give any file type after the file name.

    Check the code:
    ---------------------------------------------
    file = fopen( fileName, "r" );
    if ( file )
    {
    /* File exists, close it */

    if ( FALSE == file_close( &file ) )
    {
    Error(("file_exists: fclose failed for %s", fileName ));
    return FALSE;
    }
    }
    Error(( "File :%s cannot be opened", fileName ));
    -----------------------------------------------------

    BR
    Lakshmi Sreekanth
     
    Lakshmi Sreekanth, May 20, 2010
    #1
    1. Advertising

  2. Re: In C/Linux program How to open microsoft office outlookconfiguration file

    On 20 May, 07:17, Lakshmi Sreekanth <> wrote:
    > Hi All,
    >
    > I am trying to open a Microsoft office outlook configuration file. But
    > I am not be able to open that file. The name of the file:  PMST.
    >
    > I'm getting this error:
    >  #ERROR# File :/PERM/PLAIN/PMST cannot be opened
    >  #ERROR# FILE:/PERM/PLAIN/PMST does not exists in the device
    >
    > Pls tell me whether we need to give any file type after the file name.
    >
    > Check the code:
    > ---------------------------------------------
    >   file = fopen( fileName, "r" );
    >     if ( file )
    >         {
    >         /* File exists, close it */
    >
    >         if ( FALSE == file_close( &file ) )
    >             {
    >             Error(("file_exists: fclose failed for %s", fileName ));
    >             return FALSE;
    >             }
    >          }
    >   Error(( "File :%s cannot be opened", fileName ));
    >       -----------------------------------------------------


    sounds like the file doesn't exist...
    you probably want to re-ask this question on a platform (Linux?)
    specific new group
     
    Nick Keighley, May 20, 2010
    #2
    1. Advertising

  3. Re: In C/Linux program How to open microsoft office outlook configuration file

    Lakshmi Sreekanth <> writes:

    > I am trying to open a Microsoft office outlook configuration file. But
    > I am not be able to open that file. The name of the file: PMST.
    >
    > I'm getting this error:
    > #ERROR# File :/PERM/PLAIN/PMST cannot be opened
    > #ERROR# FILE:/PERM/PLAIN/PMST does not exists in the device
    >
    > Pls tell me whether we need to give any file type after the file name.


    If your are referring to what is often called the file name
    extension then, yes, you have to include that because it is part of the
    name.

    > Check the code:
    > ---------------------------------------------
    > file = fopen( fileName, "r" );
    > if ( file )
    > {
    > /* File exists, close it */
    >
    > if ( FALSE == file_close( &file ) )
    > {
    > Error(("file_exists: fclose failed for %s", fileName ));
    > return FALSE;
    > }
    > }
    > Error(( "File :%s cannot be opened", fileName ));


    There may be no problem. This line is probably reached (and will give
    you an error message) when the file is opened and closed successfully.
    Maybe you intended to have a else clause here? I say "probably" because
    file_close could do all kinds of unknown things including calling 'exit'.

    By the way, writing

    if (FALSE == file_close(...))

    is a bad idea. If FALSE is 0 (as it should be) then you should just
    write

    if (!file_close(...))

    If FALSE is not 0, then you need to fix that first!

    --
    Ben.
     
    Ben Bacarisse, May 20, 2010
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stephen Noronha

    Microsoft.Office.Interop.Outlook.Application

    Stephen Noronha, Sep 29, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    11,062
    Lucas Tam
    Sep 29, 2005
  2. Stan Accrington
    Replies:
    1
    Views:
    941
    Michael Borgwardt
    May 13, 2004
  3. Jesper N?hr

    How to create a simple configurationfile parser?

    Jesper N?hr, Feb 26, 2004, in forum: C Programming
    Replies:
    1
    Views:
    306
  4. GoodieMan
    Replies:
    1
    Views:
    391
    red floyd
    Apr 18, 2008
  5. GoodieMan
    Replies:
    21
    Views:
    319
    Joost Diepenmaat
    Apr 21, 2008
Loading...

Share This Page