TMDirectoryMR Code Example

long session_handle;
unsigned char state_buffer[15360];
FileEntry dir_buf;
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... */
...

dir_buf.name[0] = 'T';
dir_buf.name[1] = 'E';
dir_buf.name[2] = 'M';
dir_buf.name[3] = 'P';

/* make a sub-directory called TEMP */
result = TMDirectoryMR(session_handle, state_buffer, 0, &dir_buf);

if (result == 1)
{
   /* sub-directory TEMP made */
   ...
}
else
{
   /* error making sub-directory */
   ...
}

/* remove the sub-directory just made */
result = TMDirectoryMR(session_handle, state_buffer, 1, &dir_buf);

if (result == 1)
{
   /* sub-directory TEMP removed */
   ...
}
else
{
   /* error removing sub-directory */
   ...
}

/* close the session with a call to TMEndSession */
...