traceservices/tracefw/ulogger/src/sysconfig/configfilemanager.cpp
branchRCL_3
changeset 47 047f208ea78f
parent 0 08ec8eefde2f
child 56 839ea9debada
equal deleted inserted replaced
45:cc28652e0254 47:047f208ea78f
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
   105 	User::LeaveIfError(fs.Connect());
   105 	User::LeaveIfError(fs.Connect());
   106 
   106 
   107 	TInt error= fs.MkDir(fileName);
   107 	TInt error= fs.MkDir(fileName);
   108 	if(error==KErrNone || error== KErrAlreadyExists)
   108 	if(error==KErrNone || error== KErrAlreadyExists)
   109 		{
   109 		{
       
   110         CleanupClosePushL(fs);
   110 		CFileMan* fMan = CFileMan::NewL(fs);
   111 		CFileMan* fMan = CFileMan::NewL(fs);
   111 		CleanupStack::PushL(fMan);
   112 		CleanupStack::PushL(fMan);
   112 		fileName.Append(KConfigFilename);
   113 		fileName.Append(KConfigFilename);
   113 		User::LeaveIfError(fMan->Copy(KDefaultConfigFilePath, fileName, CFileMan::EOverWrite) );
   114 		User::LeaveIfError(fMan->Copy(KDefaultConfigFilePath, fileName, CFileMan::EOverWrite) );
   114 		CleanupStack::PopAndDestroy(fMan);
   115 		CleanupStack::PopAndDestroy(fMan);
   115 		User::LeaveIfError(fs.SetAtt(fileName,0, KEntryAttReadOnly));
   116 		User::LeaveIfError(fs.SetAtt(fileName,0, KEntryAttReadOnly));
       
   117 		CleanupStack::Pop(&fs);
   116 		}
   118 		}
   117 	fs.Close();
   119 	fs.Close();
   118 	aFilePath.Zero();
   120 	aFilePath.Zero();
   119 	aFilePath.Append(fileName);
   121 	aFilePath.Append(fileName);
   120 	return error;
   122 	return error;