Update contrib.
1 // Copyright (c) 2006-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.
14 // TTaskFilesChecker.cpp
21 // This function is used in the test code to check if there's any task files left
22 // after scheduled tasks completed
24 _LIT(KTaskFileScanDir, "_:\\Private\\10005399\\");
26 _LIT(KTaskFileWildname, "*.tmp");
28 static TInt CheckTaskFilesL()
31 User::LeaveIfError(fs.Connect());
33 //Get the correct system drive
34 TBuf<32> taskFilePath(KTaskFileScanDir);
35 taskFilePath[0] = RFs::GetSystemDriveChar();
37 // Search for task files using wildcard file name
38 TFindFile fileFinder(fs);
39 CDir* fileList = NULL;
40 TInt rel = fileFinder.FindWildByDir(KTaskFileWildname, taskFilePath, fileList);
42 // delete file list, we won't use it
46 // When any task file found left, leave with error code KErrGeneral
50 // When there's no task file left, return KErrNone
51 if (rel == KErrNotFound)
54 // Leave with KErrGeneral or any other error
55 User::LeaveIfError(rel);
60 GLDEF_C TInt E32Main()
62 TInt err = KErrNoMemory;
63 CTrapCleanup* cleanup=CTrapCleanup::New(); //can fail
67 TRAP(err, CheckTaskFilesL())