Reading Content of Directory Effectively
The RDir class allows you to open a directory and read the entries it contains. There are several different ways to read the contents of a directory.
Each call to Read() reads a single entry, which is useful in cases where memory usage needs to be minimized.
However, it is inefficient to make multiple calls to a server function, so RDir also supplies an overloaded method Read() that, in a single call, reads several entries into a TEntryArray.
The number of entries contained in each TEntryArray cannot be determined before a call to Read() because the length of each file or directory name is likely to be different.
void ReadDirContentsL(RFs& aFs, const TDesC& aDirName)
err = myDir.Read(currentEntry);
break; // No more entries, or some other error
// Process this entry
if (err != KErrEof) // EOF signifies no more entries to read