Update contrib.
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
24 _LIT(KConfigPath,"c:\\System\\Data\\stdcpp_runtest.ini");
26 _LIT(KConfigPath,"z:\\System\\Data\\stdcpp_runtest.ini");
29 TInt ReadConfig(TLex8& aTlex);
30 TInt RunProcess(TDesC8& achild, TDesC16& aParam, TInt aTimer);
38 ret = ReadConfig(aTLex);
41 printf("Failed to Read with Error value %d\n", ret);
48 TInt ReadConfig(TLex8& aTLex)
56 TInt tmp, iGiveAwaySum;
62 printf("Failure to connect to the file server\n");
65 ret = aRfile.Open(aRfs,KConfigPath,EFileRead);
69 printf("Failure to open the file\n");
72 ret = aRfile.Size(asize);
76 printf("File with no size\n");
82 printf("File with no size\n");
86 ret = aRfile.Read(data, asize);
89 printf("Cannot read the complete file\n");
98 TPtrC8 nexttoken = aTLex.NextToken();
99 copybuf.Copy(nexttoken);
100 TPtrC8 adata = aTLex.NextToken();
101 TLex8 numLexer(adata);
102 if (numLexer.Val(tmp) == KErrNone)
110 TPtrC8 nexttoken1 = aTLex.NextToken();
111 copybuf1.Copy(nexttoken1);
112 RunProcess(copybuf, copybuf1, tmp);
118 TInt RunProcess(TDesC8& achild, TDesC16& aparam, TInt atimer)
121 childpath.Copy(achild);
124 TRequestStatus processstatus, timerstatus;
125 ret = process.Create(childpath, aparam);
127 process.Logon(processstatus);
129 timeout.CreateLocal();
130 timeout.After(timerstatus, atimer*1000000);
131 User::WaitForRequest(processstatus, timerstatus);
132 if (processstatus == KRequestPending)
134 process.LogonCancel(processstatus);
135 process.Kill(KErrTimedOut);