stif/Logger/src/FileOutput.cpp
changeset 13 33016869e0dd
parent 0 a03f92240627
child 30 86a2e675b80a
equal deleted inserted replaced
0:a03f92240627 13:33016869e0dd
   474         TPtrC txtPrt( fileType );
   474         TPtrC txtPrt( fileType );
   475         iFileAndDirName.Insert( iFileAndDirName.Length(), aTestFile );
   475         iFileAndDirName.Insert( iFileAndDirName.Length(), aTestFile );
   476         iFileAndDirName.Insert( iFileAndDirName.Length(), txtPrt );
   476         iFileAndDirName.Insert( iFileAndDirName.Length(), txtPrt );
   477         }
   477         }
   478 
   478 
   479     TBool isOpen( EFalse );
   479 //  TBool isOpen( EFalse );
   480     TInt ret( KErrNone );
   480     TInt ret( KErrNone );
   481 
   481 
   482     iIsFileOpen = iFileSession.IsFileOpen( iFileAndDirName, isOpen );
   482   
       
   483     iIsFileOpen=iFile.Open( iFileSession, iFileAndDirName,
       
   484             EFileWrite | EFileStreamText |
       
   485                     EFileShareAny );
   483     if( iIsFileOpen == KErrNotFound )
   486     if( iIsFileOpen == KErrNotFound )
   484         {
   487         {
   485         ret =  iFile.Create( iFileSession, iFileAndDirName, 
   488         ret =  iFile.Create( iFileSession, iFileAndDirName, 
   486                                     EFileWrite | EFileStreamText |
   489                                     EFileWrite | EFileStreamText |
   487                                     EFileShareAny );
   490                                     EFileShareAny );
   496                 iFile.Flush();
   499                 iFile.Flush();
   497             }
   500             }
   498         }
   501         }
   499     else if( iIsFileOpen == KErrNone )
   502     else if( iIsFileOpen == KErrNone )
   500         {
   503         {
   501         ret = iFile.Open( iFileSession, iFileAndDirName,
   504       
   502                             EFileWrite | EFileStreamText |
   505         ret=KErrNone;
   503                                     EFileShareAny );
       
   504         }
   506         }
   505     // Probably path not found
   507     // Probably path not found
   506     else
   508     else
   507         {
   509         {
   508         User::Leave( iIsFileOpen );
   510         User::Leave( iIsFileOpen );