equal
deleted
inserted
replaced
|
1 /* |
|
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
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". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * Main log server engine. |
|
16 * Process log requests from multiple clients simultaneously. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 #include "utils.h" |
|
23 |
|
24 #include <f32file.h> |
|
25 |
|
26 TBool Utils::FileExists( RFs& aFs, const TDesC& aFileName ) |
|
27 { |
|
28 TBool ret = EFalse; |
|
29 TUint att; |
|
30 TInt retValue = aFs.Att( aFileName, att ); |
|
31 if( KErrNone == retValue ) |
|
32 { |
|
33 ret = ETrue; |
|
34 } |
|
35 /*else if( KErrNotFound == retValue ) |
|
36 { |
|
37 ret = EFalse; |
|
38 } |
|
39 else if( KErrPathNotFound == retValue ) |
|
40 { |
|
41 ret = EFalse; |
|
42 }*/ |
|
43 |
|
44 return ret; |
|
45 } |
|
46 |
|
47 void Utils::DeleteFile( RFs& aFs, const TDesC& aFileName ) |
|
48 { |
|
49 if ( FileExists( aFs, aFileName ) ) |
|
50 { |
|
51 aFs.Delete( aFileName ); |
|
52 } |
|
53 } |
|
54 |
|
55 void Utils::MkDir( RFs& aFs, const TDesC& aDir ) |
|
56 { |
|
57 if ( !FileExists( aFs, aDir ) ) |
|
58 { |
|
59 aFs.MkDir( aDir ); |
|
60 } |
|
61 } |