Hi,

For an application I'm writing, I'd like to determine the number of files in
a particular
directory on an expansion card. Although the attached piece of code works,
it is
rather slow (especially when there are a lot of entries in the directory).
Is there a faster way to solve this?
(ExpansionDir points to an open directory opened with VFSFileOpen)

Thanks,
Ronnie

   UInt32 dirEntryIterator=vfsIteratorStart;
   FileInfoType fileInfo;
   Err r=OK;
   UInt32 numEntries;

   fileInfo.nameP=NULL;
   fileInfo.nameBufLen=0;

   numEntries=0;
   while (dirEntryIterator!=vfsIteratorStop)
   {
      r=VFSDirEntryEnumerate (ExpansionDir, &dirEntryIterator, &fileInfo);
      numEntries++;
   }





-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to