Searching Directory

I am attempting to save multiple files on a Rabbit and then transfer these files in bulk to another Rabbit via a TCP connection.

I have been able to accomplish reading a single file in the directory entry and passing it over the TCP connection. I am unable thus far to increment to the next entry in the directory structure to increment to the next file.

//check for mounted partition
rc = fat_Open(fat_part_mounted[active_part], “”, FAT_DIR, 0, &my_file, NULL);
rc = fat_ReadDir(&my_file, &dent, FAT_INC_ALL);
rc = fat_GetName(&dent, fname, 0);
rc = fat_Open(); //open the file “fname”
rc = fat_Read(&my_file, buffer, sizeof(buffer));
//pack the TCP packet with fname and buffer
sock_write(&socket, packet, MAX_PACKET_SIZE);

For the first file saved in the root directory, I can get the filename and file content successfully sent via TCP packet to the other Rabbit.

How do I increment in the directory entry (dent) structure to the next file in the root directory?