Dear Nice Developer:

I am trying to copy all files within a directory in my
external SD Card using the code below:
It always say "Error Enumerating database" from the
custom alert that I used eventhough the specified
location exists, i.e. /backup/1 . Please help, I need
to write a backup program immediately.

FileInfoType info;
FileRef dirRef;
UInt32 dirIterator;
Char *fileName = (Char*) MemPtrNew(256);
FrmCustomAlert(frmAlertInfo, backupName, NULL,NULL);
Err err = VFSFileOpen(volRefNum, backupName,
vfsModeReadWrite, &dirRef);
if(err == errNone) {
info.nameP = fileName; // point to local buffer
info.nameBufLen = sizeof(fileName);
dirIterator = vfsIteratorStart;
while (dirIterator != vfsIteratorStop) 
{
// Get the next file
err = VFSDirEntryEnumerate (dirRef,
&dirIterator,&info);

if (err == errNone) {
FrmCustomAlert(frmAlertInfo, info.nameP, "Enumerated",
NULL);
} 
else 
{
FrmCustomAlert(frmAlertError, "Error Enumerating
database", NULL, NULL);
break;
}
}
}
else 
{
FrmCustomAlert(frmAlertError, "Error Opening backup
specified directory", NULL, NULL);
}
                
VFSFileClose(dirRef);   


__________________________________________________
Do You Yahoo!?
Log on to Messenger with your mobile phone!
http://sg.messenger.yahoo.com

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

Reply via email to