예제 #1
0
TInt CTestUtils::AppendMainLogL()
	{
	_LIT(KDisplayLogFile,"Log File %S\n");
	TParse loglocation;
	TFileName logfile;
	TInt err=ResolveLogFile(KNullDesC, loglocation);
	if(err!=KErrNone) 
		{
		iFs.MkDirAll(KMsvTestFileDefaultOutputBase);
		err=ResolveLogFile(KNullDesC, loglocation);
		}
	User::LeaveIfError(err);
	logfile.Copy(loglocation.FullName());
	logfile.Delete(logfile.Length()-1,1);
	AppendVariantName(logfile);
	iRTest.Printf(KDisplayLogFile, &logfile);
	iFs.MkDirAll(logfile);

	iLogBuf=HBufC::NewL(KMaxLogLineLength);
	iLogBuf8=HBufC8::NewL(KMaxLogLineLength);
	TInt pos=0;
	TInt ret=KErrNone;
	ret=iFile.Open(iFs,logfile,EFileWrite|EFileShareAny);
	if (ret==KErrNotFound)
		ret=iFile.Create(iFs,logfile,EFileWrite|EFileShareAny);
	if (ret==KErrNone)
		return(iFile.Seek(ESeekEnd,pos));
	else
		return(ret);
	}
예제 #2
0
TInt CTestUtils::OpenMainLogL()
	{
	_LIT(KDisplayLogFile,"Log File %S\n");
	TParse loglocation;
	TFileName logfile;
	TInt err=ResolveLogFile(KNullDesC, loglocation);
	if(err!=KErrNone) 
		{
		TChar driveChar=RFs::GetSystemDriveChar();
 		TBuf<2> systemDrive;
 		systemDrive.Append(driveChar);
 		systemDrive.Append(KDriveDelimiter);
 		TPath pathName(systemDrive) ;
		pathName.Append(KMsvTestFileDefaultOutputBase);		
		iFs.MkDirAll(pathName);
		err=ResolveLogFile(KNullDesC, loglocation);
		}
	User::LeaveIfError(err);
	logfile.Copy(loglocation.FullName());
	logfile.Delete(logfile.Length()-1,1);
	AppendVariantName(logfile);
	iRTest.Printf(KDisplayLogFile, &logfile);
	iFs.MkDirAll(logfile);

	iLogBuf=HBufC::NewL(KMaxLogLineLength);
	iLogBuf8=HBufC8::NewL(KMaxLogLineLength);
	return(iFile.Replace(iFs,logfile,EFileWrite|EFileShareAny));
	}