messagingfw/msgsrvnstore/server/src/TMsvServerStoreManager.cpp
changeset 40 320ec5cd0227
parent 0 8e480a14352b
equal deleted inserted replaced
33:61f466445ae5 40:320ec5cd0227
   379 
   379 
   380 	TFileName tempFilePathAndName;
   380 	TFileName tempFilePathAndName;
   381 	GetStoreFileName(aEntryId,tempFilePathAndName);
   381 	GetStoreFileName(aEntryId,tempFilePathAndName);
   382 
   382 
   383 	tempFilePathAndName.Append(KMsvUtilsNewExtension);
   383 	tempFilePathAndName.Append(KMsvUtilsNewExtension);
   384 	TInt error = iFs->MkDirAll(tempFilePathAndName);
   384 	
   385 	if(error == KErrNone || error == KErrAlreadyExists)
   385 	TInt error= aFile.Replace(*iFs,tempFilePathAndName,EFileShareExclusive|EFileWrite);
   386 		error = aFile.Replace(*iFs,tempFilePathAndName,EFileShareExclusive|EFileWrite);
   386 	if (error==KErrPathNotFound)
   387 
   387 		{
       
   388         //only create directory if not found
       
   389         error=iFs->MkDirAll(tempFilePathAndName);
       
   390         if (error==KErrNone)
       
   391             error=aFile.Replace(*iFs,tempFilePathAndName,EFileShareExclusive|EFileWrite);
       
   392 		}
   388 	User::LeaveIfError(error);
   393 	User::LeaveIfError(error);
       
   394 	
   389 	}
   395 	}
   390 
   396 
   391 void TMsvServerStoreManager::ReplaceFileStoreL(TMsvId aEntryId)
   397 void TMsvServerStoreManager::ReplaceFileStoreL(TMsvId aEntryId)
   392 	{
   398 	{
   393 	__ASSERT_ALWAYS(iFs != NULL, PanicServer(EMsvFileSessionNotValid));
   399 	__ASSERT_ALWAYS(iFs != NULL, PanicServer(EMsvFileSessionNotValid));