--- a/userlibandfileserver/fileserver/sfile/sf_file.cpp Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/sfile/sf_file.cpp Wed Mar 31 23:38:45 2010 +0300
@@ -462,13 +462,24 @@
__PRINT(_L("TFsIsFileOpen::DoRequestL(CFsRequest* aRequest)"));
CFileCB* file;
- TInt r=aRequest->Drive()->IsFileOpen(aRequest->Src().FullName().Mid(2),file);
- if (r!=KErrNone)
- return(r);
- TBool isOpen = file?(TBool)ETrue:(TBool)EFalse;
+ TInt r = aRequest->Drive()->IsFileOpen(aRequest->Src().FullName().Mid(2), file);
+ if (r != KErrNone)
+ return (r);
+ TBool isOpen = file ? (TBool)ETrue : (TBool)EFalse;
+ if (!isOpen)
+ {
+ // perform the existance check to retain compatibility with old-style clients
+ TEntry e;
+ r = aRequest->Drive()->Entry(aRequest->Src().FullName().Mid(2), e);
+ if (r == KErrNone && e.IsDir())
+ r = KErrArgument;
+ }
+ if (r != KErrNone)
+ return (r);
+
TPtrC8 pA((TUint8*)&isOpen,sizeof(TBool));
aRequest->WriteL(KMsgPtr1,pA);
- return(KErrNone);
+ return (KErrNone);
}
TInt TFsIsFileOpen::Initialise(CFsRequest* aRequest)