installationservices/swi/source/sisregistry/server/sisregistryutil.cpp
branchRCL_3
changeset 25 7333d7932ef7
parent 0 ba25891c3a9e
child 26 8b7f4e561641
--- a/installationservices/swi/source/sisregistry/server/sisregistryutil.cpp	Thu Aug 19 10:02:49 2010 +0300
+++ b/installationservices/swi/source/sisregistry/server/sisregistryutil.cpp	Tue Aug 31 15:21:33 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of the License "Eclipse Public License v1.0"
@@ -101,6 +101,38 @@
 		}
 	}
 
+void SisRegistryUtil::CreateFileWithAttributesL(RFs& aFs, const TDesC& aPath, const TUint aAttributesMask/*= 0*/)
+    {
+    // Creates the folder structure by ignoring the filename at the end.
+    EnsureDirExistsL(aFs, aPath);
+
+    RFile file;
+    CleanupClosePushL(file);
+    User::LeaveIfError(file.Create(aFs, aPath, EFileWrite));
+   
+    if(aAttributesMask != 0)
+        {
+        file.SetAtt(aAttributesMask, 0); // Ignoring return value.
+        }
+    CleanupStack::PopAndDestroy(&file);
+    }
+
+TInt SisRegistryUtil::DeleteFile(RFs& aFs, const TDesC& aPath)
+    {
+    TInt err = aFs.Delete(aPath);
+    
+    if(KErrNone != err)
+        {
+        DEBUG_PRINTF2(_L("Failed to delete file %S."), &aPath);
+        }
+    else
+        {
+        DEBUG_PRINTF2(_L("Deleted file %S successfully."), &aPath);
+        }
+    
+    return err;
+    }
+
 // Processes the ROM stub files. Retuns ETrue if the aUid or aName
 // is found in any of the ROM stub files, else returns EFalse.
 TBool SisRegistryUtil::RomBasedPackageL(const TUid& aUid)