A strange error in RFs::GetDir() function
| Fri, 2005-11-04 06:59 | |
|
Hi,Guys!
I meet a strange error when my programme calls RFs::GetDir(). I use a class which bases on CActive to monitor file write events under C:\system\temp\ , we just need to call RFs::NotifyChange(), so the File Server will notify my program whenever there has a file write event under C:\system\temp\. And then I can use RFs::GetDir() to get all subentries in C:\system\temp\. It works fine in most cases. But if some files under C:\system\temp\ are deleted when RFs::GetDir() is running( not before or after, just during RFs::GetDir() is running ), it will cause the phone directly restart, no error notification. I also have tried RDir, it has the same problem. And I think CDirScan will be the same. I can simulate that by using one program to monitor any directory, and another program to create,write and then delete some files under that directory,It will result the same problem:the phone resart directly! My SDK is 2.2, and my phone is Nokia 6600. thanks in advance! and sorry for my poor english! But I need your help urgetly. inter_fan |
|






Forum posts: 364
If you post your code it probably will help
Forum posts: 9
I'm trying to listen on a directory for incomming files and I think that is exactly what you doing. I had no luck getting it to work.
It would be great if you can send me your code, that will help me alot.
Thank you much.
Forum posts: 34
Here's the code:
  {
  MDesCArray* itemArray = iList->Model()->ItemTextArray();
CDesCArray* itemList = static_cast<CDesCArray*>(itemArray);
TUint a;
TText tItem;
// connect to the file server
RFs fileSession;
CDir* dirList;
TBuf<30> fileName;
TInt stat;
_LIT(KDirName, "C:\\Symbian\\8.0a\\S60_2nd_FP2\\epoc32\\wins\\c\\Nokia\\MyTindahan\\web");
_LIT(KFileSpec,"C:\\Symbian\\8.0a\\S60_2nd_FP2\\epoc32\\wins\\c\\Nokia\\MyTindahan\\web\\*");
// Connect to the file server
stat = fileSession.Connect();
// Get the file list, sorted by name (Leave if an error occurs)
User::LeaveIfError( fileSession.GetDir(KFileSpec,
KEntryAttMaskSupported,
ESortByName,
dirList));
// Close the connection with the file server
fileSession.Close();
// Dynamically build list
itemList->Delete(0);
for (TInt a=0; a < dirList->Count(); a++) {
fileName = (*dirList)[a].iName;
itemList->AppendL(fileName);
}
delete dirList;
iList->HandleItemAdditionL();Â
}
Forum posts: 34
Forum posts: 84
_LIT(KDir,"C:\\Symbian\\7.0s\\Series60_v20_CW\\Epoc32\\winscw\\c\\system\\Apps\\testlists\\*");
_LIT(KDir,"c:\\system\\Apps\\testlists\\*");
_LIT(KDir,"c:\\system\\Apps\\testlists");
any idea would be a great help for me...
cheers!!!
Nitin Sahdev
Symbian Developer
Forum posts: 84
I got the solution to my problem. The path was ok but i was not connecting to the file server.
thnx
Nitin Sahdev
Symbian Developer