nsCOMPtr <nsIFileSpec> dirSpec; rv = locator->GetFileLocation(nsSpecialFileSpec::App_DefaultUserProfileRoot50, getter_AddRefs(dirSpec));  if (NS_FAILED(rv) || !dirSpec) return NS_ERROR_FAILURE;   dirSpec->GetFileSpec(&newProfileDir); newProfileDir += newProfile;  currProfileDir.RecursiveCopy(newProfileDir);  rv = SetProfileDir(newProfile, newProfileDir); }   #if defined(DEBUG_profile) if (NS_SUCCEEDED(rv)) printf("ProfileManager : Cloned CurrentProfile to new Profile ->%s<-\n", newProfile);
nsCAutoString temp; temp.AssignWithConversion(newProfile); printf("The new profile is ->%s<-\n", NS_STATIC_CAST(const char*, temp)); }
NS_IMETHODIMP nsProfile::CloneProfile(const char* newProfile){    nsresult rv = NS_OK;#if defined(DEBUG_profile)    printf("ProfileManager : CloneProfile\n");#endif	nsFileSpec currProfileDir;	nsFileSpec newProfileDir;	GetCurrentProfileDir(&currProfileDir);	if (currProfileDir.Exists())	{		NS_WITH_SERVICE(nsIFileLocator, locator, kFileLocatorCID, &rv);		if (NS_FAILED(rv) || !locator) return NS_ERROR_FAILURE;	    	nsCOMPtr <nsIFileSpec> dirSpec;        	rv = locator->GetFileLocation(nsSpecialFileSpec::App_DefaultUserProfileRoot50, getter_AddRefs(dirSpec));        		if (NS_FAILED(rv) || !dirSpec)			return NS_ERROR_FAILURE;		//Append profile name to form a directory name	    	dirSpec->GetFileSpec(&newProfileDir);		newProfileDir += newProfile;		currProfileDir.RecursiveCopy(newProfileDir);				rv = SetProfileDir(newProfile, newProfileDir);	}#if defined(DEBUG_profile)	if (NS_SUCCEEDED(rv))		printf("ProfileManager : Cloned CurrentProfile to new Profile ->%s<-\n", newProfile);#endif	return rv;}