pkiutilities/DeviceToken/Src/Generic/Server/DevTokenUtil.cpp
branchCompilerCompatibility
changeset 8 150a5dd64ae5
parent 5 3b17fc5c9564
equal deleted inserted replaced
6:2b9c00e2ab55 8:150a5dd64ae5
    17 
    17 
    18 
    18 
    19 #include <f32file.h>
    19 #include <f32file.h>
    20 #include <s32file.h>
    20 #include <s32file.h>
    21 #include "DevTokenUtil.h"
    21 #include "DevTokenUtil.h"
       
    22 
    22 
    23 
    23 /// Read/write drive the stores reside on
    24 /// Read/write drive the stores reside on
    24 _LIT(KFileStoreStandardDrive, "C:");
    25 _LIT(KFileStoreStandardDrive, "C:");
    25 /// Rom drive where the initial store data is
    26 /// Rom drive where the initial store data is
    26 _LIT(KFileStoreROMDrive, "Z:");
    27 _LIT(KFileStoreROMDrive, "Z:");
    57 // ---------------------------------------------------------------------------
    58 // ---------------------------------------------------------------------------
    58 // FileUtils::ExistsL()
    59 // FileUtils::ExistsL()
    59 // ---------------------------------------------------------------------------
    60 // ---------------------------------------------------------------------------
    60 // 
    61 // 
    61 TBool FileUtils::ExistsL(RFs& aFs, const TDesC& aFile)
    62 TBool FileUtils::ExistsL(RFs& aFs, const TDesC& aFile)
    62     {
    63     {      
    63     TBool result = EFalse;
    64     TBool result = EFalse;
    64     TBool open;
    65     TUint attributes;
    65     TInt err = aFs.IsFileOpen(aFile, open);
    66     
    66 
    67     TInt err = aFs.Att( aFile, attributes );
    67     if (err == KErrNone)
    68            
       
    69     if ( err == KErrNone )
    68         {
    70         {
    69         result = ETrue;
    71         result = ETrue;
    70         }
    72         }
    71     else if (err != KErrNotFound && err != KErrPathNotFound)
    73     else if ( err == KErrNotFound || err == KErrPathNotFound  ) 
    72         {
    74         {
    73         User::Leave(err);
    75         result = EFalse;
       
    76         }
       
    77     else 
       
    78         {
       
    79         User::Leave( err );
    74         }
    80         }
    75 
    81 
    76     return result;
    82     return result;
    77     }
    83     }
    78 
    84