--- a/userlibandfileserver/fileserver/sfsrv/cl_fman.cpp Wed Jul 21 14:46:58 2010 +0100
+++ b/userlibandfileserver/fileserver/sfsrv/cl_fman.cpp Thu Jul 22 16:46:39 2010 +0100
@@ -15,21 +15,10 @@
#include "cl_std.h"
-#define RETURNIFERROR(a,b,t) \
- { \
- if ((a=b)!=KErrNone) \
- { \
- if(iStatus) \
- User::RequestComplete(iStatus,a); \
- TInt _t = t; \
- if (_t) {TRACE1(UTF::EBorder, t, MODULEUID, a);} \
- return(a); \
- } \
- }
-
-#define RETURNIFERRORD(a,b,t) \
- TInt a; \
- RETURNIFERROR(a,b,t)
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "cl_fmanTraces.h"
+#endif
+
const TUint KRecurseFlag = 0x40000000;
const TUint KScanDownFlag = 0x20000000;
@@ -528,14 +517,14 @@
@return Newly created CFileMan object.
*/
{
- TRACE1(UTF::EBorder, UTraceModuleEfsrv::ECFileManNewL1, MODULEUID, aFs.Handle());
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANNEWL1, "sess %x", aFs.Handle());
CFileMan* fileMan=new(ELeave) CFileMan(aFs);
CleanupStack::PushL(fileMan);
fileMan->CFileBase::ConstructL();
CleanupStack::Pop();
- TRACE1(UTF::EBorder, UTraceModuleEfsrv::ECFileManNewL1Return, MODULEUID, fileMan);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANNEWL1RETURN, "CFileMan* %x", fileMan);
return fileMan;
}
@@ -552,7 +541,7 @@
@return Newly created CFileMan object.
*/
{
- TRACE2(UTF::EBorder, UTraceModuleEfsrv::ECFileManNewL2, MODULEUID, aFs.Handle(), anObserver);
+ OstTraceExt2(TRACE_BORDER, EFSRV_ECFILEMANNEWL2, "sess %x anObserver %x", (TUint) aFs.Handle(), (TUint) anObserver);
CFileMan* fileMan=new(ELeave) CFileMan(aFs);
CleanupStack::PushL(fileMan);
@@ -560,7 +549,7 @@
CleanupStack::Pop();
fileMan->SetObserver(anObserver);
- TRACE1(UTF::EBorder, UTraceModuleEfsrv::ECFileManNewL2Return, MODULEUID, fileMan);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANNEWL2RETURN, "CFileMan* %x", fileMan);
return fileMan;
}
@@ -576,9 +565,9 @@
}
CFileMan::~CFileMan()
{
- TRACE1(UTF::EBorder, UTraceModuleEfsrv::ECFileManDestructor, MODULEUID, this);
-
- TRACE0(UTF::EBorder, UTraceModuleEfsrv::ECFileManDestructorReturn, MODULEUID);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANDESTRUCTOR, "this %x", this);
+
+ OstTrace0(TRACE_BORDER, EFSRV_ECFILEMANDESTRUCTORRETURN, "");
}
@@ -589,7 +578,7 @@
@return The action which CFileMan is carrying out.
*/
{
- TRACE1(UTF::EBorder, UTraceModuleEfsrv::ECFileManCurrentAction, MODULEUID, this);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANCURRENTACTION, "this %x", this);
TAction action = ENone;
@@ -628,7 +617,7 @@
Panic(EFManUnknownAction);
}
- TRACE1(UTF::EBorder, UTraceModuleEfsrv::ECFileManCurrentActionReturn, MODULEUID, action);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANCURRENTACTIONRETURN, "action %d", action);
return (action);
}
@@ -646,11 +635,12 @@
the current CFileMan operation
*/
{
- TRACE1(UTF::EBorder, UTraceModuleEfsrv::ECFileManGetCurrentTarget, MODULEUID, this);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANGETCURRENTTARGET, "this %x", this);
GetSrcAndTrg(iTmpParse, aTrgName);
- TRACEMULT1(UTF::EBorder, UTraceModuleEfsrv::ECFileManGetCurrentTargetReturn, MODULEUID, aTrgName);
+ OstTrace0(TRACE_BORDER, EFSRV_ECFILEMANGETCURRENTTARGETRETURN, "");
+ OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANGETCURRENTTARGET_EFILENAME, "FileName %S", aTrgName.Ptr(), aTrgName.Length()<<1);
}
@@ -667,13 +657,14 @@
CFileMan operation.
*/
{
- TRACE1(UTF::EBorder, UTraceModuleEfsrv::ECFileManGetCurrentSource, MODULEUID, this);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANGETCURRENTSOURCE, "this %x", this);
TPtrC fullPath(FullPath());
iTmpParse.Set(CurrentEntry().iName, &fullPath, NULL);
aSrcName = iTmpParse.FullName();
- TRACEMULT1(UTF::EBorder, UTraceModuleEfsrv::ECFileManGetCurrentSourceReturn, MODULEUID, aSrcName);
+ OstTrace0(TRACE_BORDER, EFSRV_ECFILEMANGETCURRENTSOURCERETURN, "");
+ OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANGETCURRENTSOURCE_EFILENAME, "FileName %S", aSrcName.Ptr(), aSrcName.Length()<<1);
}
void CFileMan::GetSrcAndTrg(TParse& aSrcName,TFileName& aTrgName)
@@ -734,7 +725,7 @@
@return The number of bytes transferred.
*/
{
- TRACE2(UTF::EBorder, UTraceModuleEfsrv::ECFileManBytesTransferredByCopyStep, MODULEUID, this, iBytesTransferred);
+ OstTraceExt2(TRACE_BORDER, EFSRV_ECFILEMANBYTESTRANSFERREDBYCOPYSTEP, "this %x BytesTransferred %d", (TUint) this, (TUint) iBytesTransferred);
return(iBytesTransferred);
}
@@ -904,8 +895,9 @@
*/
{
- TRACEMULT8(UTF::EBorder, UTraceModuleEfsrv::ECFileManAttribs1, MODULEUID,
- (TUint) this, aName, aSetMask, aClearMask, I64LOW(aTime.Int64()), I64HIGH(aTime.Int64()), aSwitches, (TUint) &aStatus);
+ OstTraceExt5(TRACE_BORDER, EFSRV_ECFILEMANATTRIBS1A, "this %x aSetMask %x aClearMask %x aSwitches %d status %x", (TUint) this, (TUint) aSetMask, (TUint) aClearMask, (TUint) aSwitches, (TUint) &aStatus);
+ OstTraceExt2(TRACE_BORDER, EFSRV_ECFILEMANATTRIBS1B, "aTime %x:%x ", (TUint) I64HIGH(aTime.Int64()), (TUint) I64LOW(aTime.Int64()));
+ OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANATTRIBS1A_EFILEPATH, "FilePath %S", aName.Ptr(), aName.Length()<<1);
TInt r;
if (iSwitches&KFManBusyFlag)
@@ -918,7 +910,8 @@
r = Attribs(aName,aSetMask,aClearMask,aTime,aSwitches);
}
- TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECFileManAttribs1Return, MODULEUID, r);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANATTRIBS1RETURN, "r %d", r);
+
return r;
}
@@ -974,8 +967,9 @@
*/
{
- TRACEMULT7(UTF::EBorder, UTraceModuleEfsrv::ECFileManAttribs2, MODULEUID,
- (TUint) this, aName, aSetMask, aClearMask, I64LOW(aTime.Int64()), I64HIGH(aTime.Int64()), aSwitches);
+ OstTraceExt4(TRACE_BORDER, EFSRV_ECFILEMANATTRIBS2A, "this %x aSetMask %x aClearMask %x aSwitches %x", (TUint) this, (TUint) aSetMask, (TUint) aClearMask, (TUint) aSwitches);
+ OstTraceExt2(TRACE_BORDER, EFSRV_ECFILEMANATTRIBS2B, "aTime %x:%x ", (TUint) I64HIGH(aTime.Int64()), (TUint) I64LOW(aTime.Int64()));
+ OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANATTRIBS2A_EFILEPATH, "FilePath %S", aName.Ptr(), aName.Length()<<1);
TInt ret;
if (iSwitches&KFManBusyFlag)
@@ -985,7 +979,15 @@
else
{
SetFlags(aSwitches&EOverWrite,aSwitches&ERecurse,ETrue,EFalse);
- RETURNIFERRORD(r,iFs.Parse(aName,iSrcFile),UTraceModuleEfsrv::ECFileManAttribs2Return);
+ TInt r;
+ if ((r = iFs.Parse(aName,iSrcFile)) != KErrNone)
+ {
+ if(iStatus)
+ User::RequestComplete(iStatus,r);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANATTRIBS2RETURN1, "r %d", r);
+ return r;
+ }
+
iSetMask=aSetMask;
iClearMask=aClearMask;
iTime=aTime;
@@ -997,7 +999,8 @@
DoSynchronize(r);
}
- TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECFileManAttribs2Return, MODULEUID, ret);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANATTRIBS2RETURN2, "r %d", ret);
+
return(ret);
}
@@ -1037,8 +1040,9 @@
*/
{
- TRACEMULT5(UTF::EBorder, UTraceModuleEfsrv::ECFileManCopy1, MODULEUID,
- (TUint) this, anOld, aNew, aSwitches, (TUint) &aStatus);
+ OstTraceExt3(TRACE_BORDER, EFSRV_ECFILEMANCOPY1, "this %x aSwitches %x status %x", (TUint) this, (TUint) aSwitches, (TUint) &aStatus);
+ OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANCOPY1_EOLDNAME, "OldName %S", anOld.Ptr(), anOld.Length()<<1);
+ OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANCOPY1_ENEWNAME, "NewName %S", aNew.Ptr(), aNew.Length()<<1);
TInt r;
if (iSwitches&KFManBusyFlag)
@@ -1049,7 +1053,8 @@
r = Copy(anOld,aNew,aSwitches);
}
- TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECFileManCopy1Return, MODULEUID, r);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANCOPY1RETURN, "r %d", r);
+
return(r);
}
@@ -1089,6 +1094,31 @@
including any directories in the path specified by aNew which do not
already exist.
+If the source (anOld) is a FILE and the recursive operation is set,
+then all the files with the same name as anOld in the source directory
+including those in subdirectories will be copied to the destination.
+
+For example, the initial directory structure is as follows:
+C:\dir1\file.txt
+C:\dir1\subdirA\file.txt
+C:\dir1\subdirB\file.txt
+
+@code
+CFileMan* fm(CFileMan::NewL(iFs)); // Where iFs is an RFs handle
+fm->Copy(_L("C:\\dir1\\file.txt"), _L("C:\\dir2\\file.txt"), CFileMan::ERecurse);
+// OR without specifying the filename in aNew:
+fm->Copy(_L("C:\\dir1\\file.txt"), _L("C:\\dir2\\"), CFileMan::ERecurse);
+@endcode
+
+Because of the recursive behaviour, the final directory structure after
+either one of the copy operations above will be as follows:
+C:\dir1\file.txt
+C:\dir1\subdirA\file.txt
+C:\dir1\subdirB\file.txt
+C:\dir2\file.txt
+C:\dir2\subdirA\file.txt
+C:\dir2\subdirB\file.txt
+
If recursive operation is not set, only the matching files located in
the single directory specified in anOld are copied.
No intermediate directories will be created; if any directories in
@@ -1122,13 +1152,13 @@
1.2 If there is no file to operate on i.e. if source directory is empty, the
function will do nothing and return error code KErrNotFound.
- 2. Files can be copied across drives.
-
- 3. Open files can be copied if they have been opened using
- the EFileShareReadersOnly file share mode.
-
- 4. Read-only, hidden and system files can be copied and
- the source file's attributes are preserved in the target file.
+ 2. Files can be copied across drives.
+
+ 3. Open files can be copied if they have been opened using
+ the EFileShareReadersOnly file share mode.
+
+ 4. Read-only, hidden and system files can be copied and
+ the source file's attributes are preserved in the target file.
@param anOld Path indicating the file(s) to be copied.
Any path components which are not specified here will be
@@ -1153,21 +1183,38 @@
*/
{
- TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::ECFileManCopy2, MODULEUID, (TUint) this, anOld, aNew, aSwitches);
+ OstTraceExt2(TRACE_BORDER, EFSRV_ECFILEMANCOPY2, "this %x aSwitches %d", (TUint) this, (TUint) aSwitches);
+ OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANCOPY2_EOLDNAME, "OldName %S", anOld.Ptr(), anOld.Length()<<1);
+ OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANCOPY2_ENEWNAME, "NewName %S", aNew.Ptr(), aNew.Length()<<1);
if (iSwitches&KFManBusyFlag)
{
- TRACE1(UTF::EBorder, UTraceModuleEfsrv::ECFileManCopy2Return, MODULEUID, KErrInUse);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANCOPY2RETURN1, "r %d", KErrInUse);
return(KErrInUse);
}
SetFlags(aSwitches&EOverWrite,aSwitches&ERecurse,ETrue,EFalse);
- RETURNIFERRORD(r,iFs.Parse(anOld,iSrcFile),UTraceModuleEfsrv::ECFileManCopy2Return);
- RETURNIFERROR(r,iFs.Parse(aNew,_L("*"),iTrgFile),UTraceModuleEfsrv::ECFileManCopy2Return);
+ TInt r;
+ if ((r = iFs.Parse(anOld,iSrcFile)) != KErrNone)
+ {
+ if(iStatus)
+ User::RequestComplete(iStatus,r);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANCOPY2RETURN2, "r %d", r);
+ return r;
+ }
+
+ if ((r = iFs.Parse(aNew,_L("*"),iTrgFile)) != KErrNone)
+ {
+ if(iStatus)
+ User::RequestComplete(iStatus,r);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANCOPY2RETURN3, "r %d", r);
+ return r;
+ }
+
CheckForDirectory();
if((iSwitches&KRecurseFlag) && iTrgFile.DriveAndPath().MatchF(iSrcFile.FullName()) != KErrNotFound)
{
- TRACE1(UTF::EBorder, UTraceModuleEfsrv::ECFileManCopy2Return, MODULEUID, KErrArgument);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANCOPY2RETURN4, "r %d", KErrArgument);
return(KErrArgument);
}
@@ -1178,7 +1225,8 @@
TInt ret=(r==KErrNone) ? iLastError : r;
DoSynchronize(r);
- TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECFileManCopy2Return, MODULEUID, ret);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANCOPY2RETURN5, "r %d", ret);
+
return(ret);
}
@@ -1218,7 +1266,8 @@
@see KNullDesC
*/
{
- TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::ECFileManDelete1, MODULEUID, (TUint) this, aName, aSwitches, (TUint) &aStatus);
+ OstTraceExt3(TRACE_BORDER, EFSRV_ECFILEMANDELETE1, "this %x aSwitches %x status %x", (TUint) this, (TUint) aSwitches, (TUint) &aStatus);
+ OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANDELETE1_EFILEPATH, "FilePath %S", aName.Ptr(), aName.Length()<<1);
TInt r;
if (iSwitches&KFManBusyFlag)
@@ -1231,7 +1280,8 @@
r = Delete(aName,aSwitches);
}
- TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECFileManDelete1Return, MODULEUID, r);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANDELETE1RETURN, "r %d", r);
+
return(r);
}
@@ -1278,7 +1328,8 @@
@see KNullDesC
*/
{
- TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::ECFileManDelete2, MODULEUID, (TUint) this, aName, aSwitches);
+ OstTraceExt2(TRACE_BORDER, EFSRV_ECFILEMANDELETE2, "this %x aSwitches %d", (TUint) this, (TUint) aSwitches);
+ OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANDELETE2_EFILEPATH, "FilePath %S", aName.Ptr(), aName.Length()<<1);
TInt ret;
if (iSwitches&KFManBusyFlag)
@@ -1288,7 +1339,15 @@
else
{
SetFlags(aSwitches&EOverWrite,aSwitches&ERecurse,ETrue,EFalse);
- RETURNIFERRORD(r,iFs.Parse(aName,iSrcFile),UTraceModuleEfsrv::ECFileManDelete2Return);
+ TInt r;
+ if ((r = iFs.Parse(aName,iSrcFile)) != KErrNone)
+ {
+ if(iStatus)
+ User::RequestComplete(iStatus,r);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANDELETE2RETURN1, "() r %d", r);
+ return r;
+ }
+
iAction = EInternalDelete;
iMatchEntry=KEntryAttHidden|KEntryAttMatchExclude|KEntryAttDir;
// Exclude directories and system files - include hidden files
@@ -1298,7 +1357,8 @@
DoSynchronize(r);
}
- TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECFileManDelete2Return, MODULEUID, ret);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANDELETE2RETURN2, "() r %d", ret);
+
return(ret);
}
@@ -1342,8 +1402,9 @@
*/
{
- TRACEMULT5(UTF::EBorder, UTraceModuleEfsrv::ECFileManMove1, MODULEUID,
- (TUint) this, anOld, aNew, aSwitches, (TUint) &aStatus);
+ OstTraceExt3(TRACE_BORDER, EFSRV_ECFILEMANMOVE1, "this %x aSwitches %x status %x", (TUint) this, (TUint) aSwitches, (TUint) &aStatus);
+ OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANMOVE1_EOLDNAME, "OldName %S", anOld.Ptr(), anOld.Length()<<1);
+ OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANMOVE1_ENEWNAME, "NewName %S", aNew.Ptr(), aNew.Length()<<1);
TInt r;
if (iSwitches&KFManBusyFlag)
@@ -1356,7 +1417,8 @@
r = Move(anOld,aNew,aSwitches);
}
- TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECFileManMove1Return, MODULEUID, r);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANMOVE1RETURN, "r %d", r);
+
return r;
}
@@ -1393,7 +1455,7 @@
recursively by default and moves both the last directory level and all of its content.
Notice that no trailing backslash ("\") implies moving files recursively automatically.
-For example, if the directory level "b" contains the files F1,F2 and F3, then:
+For example, if the directory level "b" contains the files F1, F2 and F3, then:
@code
CFileMan* fm(CFileMan::NewL(iFs)); // Where iFs is an RFs handle
...
@@ -1421,7 +1483,7 @@
0 is passed as an argument, the operation behaves the same way as by passing
CFileMan::ERecurse flag.
-for example:
+For example:
@code
CFileMan* fm(CFileMan::NewL(iFs)); // Where iFs is an RFs handle
...
@@ -1436,6 +1498,31 @@
fm->Move(_L("C:\\a\\b"), _L("C:\\x\\y\\"), CFileMan::ERecurse);
@endcode
+If the source (anOld) is a FILE and the recursive operation is set,
+then all the files with the same name as anOld in the source directory
+including those in subdirectories will be moved to the destination.
+
+For example, the initial directory structure is as follows:
+C:\src\file.txt
+C:\src\subdirA\file.txt
+C:\src\subdirB\file.txt
+
+@code
+CFileMan* fm(CFileMan::NewL(iFs)); // Where iFs is an RFs handle
+fm->Move(_L("C:\\src\\file.txt"), _L("C:\\dest\\file.txt"), CFileMan::ERecurse);
+// OR without specifying the filename in aNew:
+fm->Move(_L("C:\\src\\file.txt"), _L("C:\\dest\\"), CFileMan::ERecurse);
+@endcode
+
+Because of the recursive behaviour, the final directory structure after
+either one of the move operations above will be as follows:
+C:\src\
+C:\src\subdirA\
+C:\src\subdirB\
+C:\dest\file.txt
+C:\dest\subdirA\file.txt
+C:\dest\subdirB\file.txt
+
Notes:
-# Read-only, hidden and system files can be moved and the source file's
@@ -1443,7 +1530,7 @@
be moved. Attempting to move an open file will return an error for
that file, as retrieved by CFileBase::GetLastError().
-@param anOld Path indicating the files to be moved. May be either a full path, or
+@param anOld Path indicating the directory/files to be moved. May be either a full path, or
relative to the session path. Note that if you specify a directory level,
then the behaviour of the move operation is sensitive to the presence
(or absence) of a trailing backslash ("\") character. Any path components
@@ -1471,20 +1558,36 @@
@see CFileBase::GetLastError()
*/
{
- TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::ECFileManMove2, MODULEUID,
- (TUint) this, anOld, aNew, aSwitches);
+ OstTraceExt2(TRACE_BORDER, EFSRV_ECFILEMANMOVE2, "this %x aSwitches %d", (TUint) this, (TUint) aSwitches);
+ OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANMOVE2_EOLDNAME, "OldName %S", anOld.Ptr(), anOld.Length()<<1);
+ OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANMOVE2_ENEWNAME, "NewName %S", aNew.Ptr(), aNew.Length()<<1);
if (iSwitches&KFManBusyFlag)
{
- TRACE1(UTF::EBorder, UTraceModuleEfsrv::ECFileManMove2Return, MODULEUID, KErrInUse);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANMOVE2RETURN1, "r %d", KErrInUse);
return(KErrInUse);
}
iNumberOfFilesProcessed = 0;
- RETURNIFERRORD(r,iFs.Parse(anOld,iSrcFile),UTraceModuleEfsrv::ECFileManMove2Return);
- RETURNIFERROR(r,iFs.Parse(aNew,_L("*"),iTrgFile),UTraceModuleEfsrv::ECFileManMove2Return);
+ TInt r;
+ if ((r = iFs.Parse(anOld,iSrcFile)) != KErrNone)
+ {
+ if(iStatus)
+ User::RequestComplete(iStatus,r);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANMOVE2RETURN2, "r %d", r);
+ return r;
+ }
+
+ if ((r = iFs.Parse(aNew,_L("*"),iTrgFile)) != KErrNone)
+ {
+ if(iStatus)
+ User::RequestComplete(iStatus,r);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANMOVE2RETURN3, "r %d", r);
+ return r;
+ }
+
TInt ret = KErrNone;
TBool aComplete = EFalse;
@@ -1503,7 +1606,7 @@
{
User::RequestComplete(iStatus, ret);
}
- TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECFileManMove2Return, MODULEUID, ret);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANMOVE2RETURN4, "r %d", ret);
return(ret);
}
@@ -1518,7 +1621,8 @@
ret = (r==KErrNone) ? iLastError : r;
DoSynchronize(r);
- TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECFileManMove2Return, MODULEUID, ret);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANMOVE2RETURN5, "r %d", ret);
+
return(ret);
}
@@ -1865,8 +1969,9 @@
*/
{
- TRACEMULT5(UTF::EBorder, UTraceModuleEfsrv::ECFileManRename1, MODULEUID,
- (TUint) this, aName, aNewName, aSwitches, (TUint) &aStatus);
+ OstTraceExt3(TRACE_BORDER, EFSRV_ECFILEMANRENAME1, "this %x aSwitches %x status %x", (TUint) this, (TUint) aSwitches, (TUint) &aStatus);
+ OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANRENAME1_EOLDNAME, "OldName %S", aName.Ptr(), aName.Length()<<1);
+ OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANRENAME1_ENEWNAME, "NewName %S", aNewName.Ptr(), aNewName.Length()<<1);
TInt r;
if (iSwitches&KFManBusyFlag)
@@ -1879,7 +1984,8 @@
r = Rename(aName,aNewName,aSwitches);
}
- TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECFileManRename1Return, MODULEUID, r);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANRENAME1RETURN, "r %d", r);
+
return(r);
}
@@ -2045,8 +2151,9 @@
*/
{
- TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::ECFileManRename2, MODULEUID,
- (TUint) this, aName, aNewName, aSwitches);
+ OstTraceExt2(TRACE_BORDER, EFSRV_ECFILEMANRENAME2, "this %x aSwitches %d", (TUint) this, (TUint) aSwitches);
+ OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANRENAME2_EOLDNAME, "OldName %S", aName.Ptr(), aName.Length()<<1);
+ OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANRENAME2_ENEWNAME, "NewName %S", aNewName.Ptr(), aNewName.Length()<<1);
TInt ret;
if (iSwitches&KFManBusyFlag)
@@ -2056,8 +2163,22 @@
else
{
SetFlags(aSwitches&EOverWrite,EFalse,ETrue,EFalse);
- RETURNIFERRORD(r,iFs.Parse(aName,iSrcFile),UTraceModuleEfsrv::ECFileManRename2Return);
- RETURNIFERROR(r,iFs.Parse(aNewName,_L("*"),iTrgFile),UTraceModuleEfsrv::ECFileManRename2Return);
+ TInt r;
+ if ((r = iFs.Parse(aName,iSrcFile)) != KErrNone)
+ {
+ if(iStatus)
+ User::RequestComplete(iStatus,r);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANRENAME2RETURN1, "r %d", r);
+ return r;
+ }
+
+ if ((r = iFs.Parse(aNewName,_L("*"),iTrgFile)) != KErrNone)
+ {
+ if(iStatus)
+ User::RequestComplete(iStatus,r);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANRENAME2RETURN2, "r %d", r);
+ return r;
+ }
iAction = EInternalRename;
iMatchEntry=KEntryAttMaskSupported;
@@ -2067,7 +2188,8 @@
DoSynchronize(r);
}
- TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECFileManRename2Return, MODULEUID, ret);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANRENAME2RETURN3, "r %d", ret);
+
return(ret);
}
@@ -2097,7 +2219,8 @@
*/
{
- TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::ECFileManRmDir1, MODULEUID, (TUint) this, aDirName, (TUint) &aStatus);
+ OstTraceExt2(TRACE_BORDER, EFSRV_ECFILEMANRMDIR1, "this %x status %x", (TUint) this, (TUint) &aStatus);
+ OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANRMDIR1_EDIRNAME, "Dir %S", aDirName.Ptr(), aDirName.Length()<<1);
TInt r;
if (iSwitches&KFManBusyFlag)
@@ -2110,7 +2233,8 @@
r = RmDir(aDirName);
}
- TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECFileManRmDir1Return, MODULEUID, r);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANRMDIR1RETURN, "r %d", r);
+
return r;
}
@@ -2145,7 +2269,8 @@
*/
{
- TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::ECFileManRmDir2, MODULEUID, (TUint) this, aDirName);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANRMDIR2, "this %x", (TUint) this);
+ OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANRMDIR2_EDIRNAME, "Dir %S", aDirName.Ptr(), aDirName.Length()<<1);
TInt ret;
if (iSwitches&KFManBusyFlag)
@@ -2155,7 +2280,15 @@
else
{
SetFlags(ETrue,ETrue,EFalse,EFalse);
- RETURNIFERRORD(r,iFs.Parse(aDirName,iTrgFile),UTraceModuleEfsrv::ECFileManRmDir2Return);
+ TInt r;
+ if ((r = iFs.Parse(aDirName,iTrgFile)) != KErrNone)
+ {
+ if(iStatus)
+ User::RequestComplete(iStatus,r);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANRMDIR2RETURN1, "r %d", r);
+ return r;
+ }
+
iSrcFile.Set(iTrgFile.DriveAndPath(),NULL,NULL);
iAction = EInternalRmDir;
iMatchEntry=KEntryAttMaskSupported;
@@ -2165,7 +2298,8 @@
ret = (r!=KErrNone) ? iLastError : KErrNone;
}
- TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECFileManRmDir2Return, MODULEUID, ret);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANRMDIR2RETURN2, "r %d", ret);
+
return ret;
}
@@ -2563,8 +2697,8 @@
@capability Dependent If the path for aNew begins with /Resource then Tcb capability is required.
*/
{
- TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::ECFileManCopy3, MODULEUID,
- (TUint) this, anOld.SubSessionHandle(), aNew, aSwitches);
+ OstTraceExt3(TRACE_BORDER, EFSRV_ECFILEMANCOPY3, "this %x anOldSubs %x aSwitches %x", (TUint) this, (TUint) anOld.SubSessionHandle(), (TUint) aSwitches);
+ OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANCOPY3_ENEWNAME, "NewName %S", aNew.Ptr(), aNew.Length()<<1);
TInt ret;
if (iSwitches&KFManBusyFlag)
@@ -2586,11 +2720,23 @@
iSwitches|= KCopyFromHandle;
TInt r;
- RETURNIFERROR(r, iFs.Parse(aNew, iTrgFile),UTraceModuleEfsrv::ECFileManCopy3Return);
+ if ((r = iFs.Parse(aNew, iTrgFile)) != KErrNone)
+ {
+ if(iStatus)
+ User::RequestComplete(iStatus,r);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANCOPY3RETURN1, "r %d", r);
+ return r;
+ }
// Need to duplicate the RFile handle so that any threads owned
// by this process can use it - i.e. the worker thread
- RETURNIFERROR(r, iSrcFileHandle.Duplicate(anOld, EOwnerProcess),UTraceModuleEfsrv::ECFileManCopy3Return);
+ if ((r = iSrcFileHandle.Duplicate(anOld, EOwnerProcess)) != KErrNone)
+ {
+ if(iStatus)
+ User::RequestComplete(iStatus,r);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANCOPY3RETURN2, "r %d", r);
+ return r;
+ }
iAction = EInternalCopyFromHandle;
iNumberOfFilesProcessed = 0;
@@ -2599,7 +2745,8 @@
DoSynchronize(r);
}
- TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECFileManCopy3Return, MODULEUID, ret);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANCOPY3RETURN3, "r %d", ret);
+
return(ret);
}
@@ -2635,8 +2782,8 @@
@capability Dependent If the path for aNew begins with /Resource then Tcb capability is required.
*/
{
- TRACEMULT5(UTF::EBorder, UTraceModuleEfsrv::ECFileManCopy4, MODULEUID,
- (TUint) this, anOld.SubSessionHandle(), aNew, aSwitches, (TUint) &aStatus);
+ OstTraceExt4(TRACE_BORDER, EFSRV_ECFILEMANCOPY4, "this %x anOldSubs %x aSwitches %dstatus %x", (TUint) this, (TUint) anOld.SubSessionHandle(), (TUint) aSwitches, (TUint) &aStatus);
+ OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANCOPY4_ENEWNAME, "NewName %S", aNew.Ptr(), aNew.Length()<<1);
TInt r;
if (iSwitches&KFManBusyFlag)
@@ -2649,7 +2796,8 @@
r = Copy(anOld,aNew,aSwitches);
}
- TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECFileManCopy4Return, MODULEUID, r);
+ OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANCOPY4RETURN, "r %d", r);
+
return(r);
}
@@ -2711,8 +2859,21 @@
{
TInt64 rem;
#endif
- RETURNIFERRORD(r,aSrcFile.Size(rem),EFalse);
- RETURNIFERROR(r, aDstFile.SetSize(rem),EFalse);
+ TInt r;
+ if ((r = aSrcFile.Size(rem)) != KErrNone)
+ {
+ if(iStatus)
+ User::RequestComplete(iStatus,r);
+ return r;
+ }
+
+
+ if ((r = aDstFile.SetSize(rem)) != KErrNone)
+ {
+ if(iStatus)
+ User::RequestComplete(iStatus,r);
+ return r;
+ }
HBufC8* bufPtr = NULL;
bufPtr = AllocateBuffer(rem);