messagingfw/msgsrvnstore/server/src/TMsvServerStoreManager.cpp
branchRCL_3
changeset 20 e4175d61d967
parent 0 8e480a14352b
child 22 d2c4c66342f3
equal deleted inserted replaced
18:b9e74fff3740 20:e4175d61d967
   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));