TMNextFile Code Example
long session_handle;
unsigned char state_buffer[15360];
FileEntry fentry;
char buf[100];
short result;
/* session_handle set from a call to TMExtendedStartSession */
...
/* get the unique registration number of the device to communicate with using TMFirst,TMNext,TMRom... */
...
/* loop to get all of the files in the current directory */
/* get the first file */
result = TMFirstFile(session_handle,state_buffer,&fentry)
/* loop while files are being found */
while(result > 0)
{
/* get the file information */
sprintf(buf,"File is %.4s.%03d",
fentry.name,fentry.extension);
...
/* get the next file */
result = TMNextFile(session_handle,state_buffer,&fentry);
}
/* close the session with a call to TMEndSession */
...