First public contribution.
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
19 // This function is used in the test code to create dummy test files to verify
20 //that these files are deleted by the task scheduler on startup
21 _LIT(KTaskFile1Name, "_:\\Private\\10005399\\12345678901234567890.tmp");
22 _LIT(KTaskFile2Name, "_:\\Private\\10005399\\98765432100123456789.tmp");
23 _LIT(KTaskFile3Name, "_:\\Private\\10005399\\98765432109876543210.tmp");
25 static TInt CreateFileL(const TDesC& aFileName)
30 User::LeaveIfError(fs.Connect());
32 //Get the correct system drive
33 TBuf<64> filePath(aFileName);
34 filePath[0] = RFs::GetSystemDriveChar();
36 //Create the temp file
37 TInt res = taskFile.Create(fs,filePath,EFileRead);
45 static TInt CreateTaskFilesL()
48 //Create the temp file
49 TInt res = CreateFileL(KTaskFile1Name);
53 res = CreateFileL(KTaskFile2Name);
58 res = CreateFileL(KTaskFile3Name);
65 GLDEF_C TInt E32Main()
67 TInt err = KErrNoMemory;
68 CTrapCleanup* cleanup=CTrapCleanup::New(); //can fail
72 TRAP(err, CreateTaskFilesL())