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

L

Lakshmi Sreekanth

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
 
N

Nick Keighley

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
 
B

Ben Bacarisse

Lakshmi Sreekanth said:
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!
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top