Hy
I want to find all the file from a memory card, from all the directories. My 
code looks like this: 

Char dir[80]=""
UInt16 vn;
UInt32 it;
FileRef fref;
FileInfoType finfo;
Char names[10][80];
ListType *list;

char tmppath[11];

char **lista= (char**) MemPtrNew(sizeof(char*)*80);

it = vfsIteratorStart;
list= FrmGetObjectPtr(frmP, FrmGetObjectIndex(frmP, MainList));

i=0;
it = vfsIteratorStart;
if (VFSVolumeEnumerate (&vn, &it))
        return;
StrCopy (dir, "/"); 
if (!VFSFileOpen (vn, dir, vfsModeRead, &fref))
{
index = 0;
finfo.nameBufLen = 256;
finfo.nameP = names[index];
while ((it != vfsIteratorStop) && index<10) {
  if (!VFSDirEntryEnumerate (fref, &it, &finfo)) 
            break; 
// here my code brakes, even if I am using a Clie Simulator that has a Card, 
And I have files on my card.
  StrCopy (tmppath, dir);
  StrCat  (tmppath, "/");
  StrCat  (tmppath, names[index]);
  StrCat(lista[index],tmppath);
  index++;
  }
  VFSFileClose (fref);

for( i = 0; i < index; i ++ )
                {
                LstSetListChoices( list,lista,i);
                LstDrawList( list );                                            
                        }       
}
else
        FrmAlert(VolumeAlert);

I am trying to list all the elements from the Card into a list on my MainForm. 
I don't care (at this point) if I am working with a directory or a file, I want 
them listed.

Can anyone tell me where is the problem? The debugger is not working with this 
type of device, and I can't find the problem.

Regards, Iulia


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

Reply via email to