A strange error in RFs::GetDir() function

Login to reply to this topic.
Fri, 2005-11-04 06:59
Joined: 2005-09-04
Forum posts: 4
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

Fri, 2005-11-04 20:11
Joined: 2004-07-10
Forum posts: 364
Re: A strange error in RFs::GetDir() function
Maybe you  have some problem in your code due to the fact that you are executing one activity (GetDir()) while simultaneously you receive notification of a change. If your code can't handle the two things happening simultaneously you will get a problem.

If you post your code it probably will help
Sat, 2005-11-05 20:52
Joined: 2005-08-30
Forum posts: 9
Re: A strange error in RFs::GetDir() function
Hi,
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.
Wed, 2005-11-16 12:10
Joined: 2005-11-16
Forum posts: 34
Re: A strange error in RFs::GetDir() function
I'm also having a problem with the GetDir() function. I figured somebody here can find out why  I'm having "Memory Leak" ALLOC xxxxxxx error when the function is issued.

Here's the code:

Code:
void CHTMLContainer::SetListData()
    {
    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(); 
}
Tue, 2005-11-29 11:05
Joined: 2005-11-16
Forum posts: 34
Re: A strange error in RFs::GetDir() function
OK. The root of this error is worng path.  That triggers the error. I should have written an error-handler for this one.
Thu, 2006-07-13 07:10
Joined: 2006-04-28
Forum posts: 84
Re: A strange error in RFs::GetDir() function
I am also having the problem in GetDir() method. the path i have tried for the literal were

   _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

Thu, 2006-07-13 08:49
Joined: 2006-04-28
Forum posts: 84
Re: A strange error in RFs::GetDir() function
hi all

  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

  • Login to reply to this topic.