cryptomgmtlibs/securityutils/source/sectcbutil/miscutil.cpp
changeset 29 ece3df019add
parent 8 35751d3474b7
equal deleted inserted replaced
19:cd501b96611d 29:ece3df019add
    85  * @param aFs		Connected  filesystem session
    85  * @param aFs		Connected  filesystem session
    86  * @param aPath		Fully qualified path to start the recursive delete
    86  * @param aPath		Fully qualified path to start the recursive delete
    87  */
    87  */
    88 EXPORT_C void DeletePathIfEmpty(RFs& aFs, const TDesC& aPath)
    88 EXPORT_C void DeletePathIfEmpty(RFs& aFs, const TDesC& aPath)
    89 	{
    89 	{
    90 	HBufC* pathBuf = aPath.AllocLC();
    90 	TParse path;
    91 	TPtr pathPtr(pathBuf->Des());
    91 	path.Set(aPath,NULL,NULL);
    92 	TParsePtr path(pathPtr);
       
    93 
    92 
    94 	if (path.PathPresent())
    93 	if (path.PathPresent())
    95 		{
    94 		{
    96 		while ((aFs.RmDir(path.DriveAndPath()) == KErrNone) && (path.PopDir() == KErrNone))
    95 		while ((aFs.RmDir(path.DriveAndPath()) == KErrNone) && (path.PopDir() == KErrNone))
    97 			;
    96 			;
    98 		}
    97 		}		
    99 	CleanupStack::PopAndDestroy(pathBuf);
       
   100 	}
    98 	}
   101 
    99 
   102 }	// namespace MiscUtil
   100 }	// namespace MiscUtil