Problem while retriving content from a directory...?
| Fri, 2008-03-14 16:16 | |
|
Hi rbrunner this is amit once again. I am havins some problems regarding GetDir() function. RFs aFs; if(aFs.GetDir(aRootFolderPath,KEntryAttNormal,ESortByName, anEntryList, aDirList)==KErrNone) But the issue is that in variable [i]length [b] i am getting some garbage value and the iName is not returning anything. |
|






Forum posts: 1248
I am not sure what is the problem, but I am pretty sure that the code you list here is not the code that you really execute, because what you list here does not compile in at least two places:
for(TInt i= 0;iCount();i++)TInt length=(*aDirList).iName.Length();You might check again and post the real code here.
René Brunner
Forum posts: 18
RFs aFs;
aFs.Connect();
CDir *aDirList ;
CDir *anEntryList;
if(aFs.GetDir(aRootFolderPath,KEntryAttNormal,ESortByName, anEntryList, aDirList)==KErrNone)
{
TInt length=(*aDirList).iName.Length();
TBuf<512> name =(*aDirList)[i].iName;
.....................................................
}
Forum posts: 1248
TInt length=(*aDirList).iName.Length();This line does not make sense to me, and if it compiles, I don't know why. aDirList is a pointer to something like an array, so (*aDirList) cannot directly have a component .iName, like you write. Maybe what you want is this:
TInt length=(*aDirList)[i].iName.Length();for checking the length of the name of the first entry (with i=0) in the array?
René Brunner