# Searching Directory

**URL:** <https://forums.digi.com/t/searching-directory/10934>\
**Category:** Rabbit\
**Created:** [April 8, 2009, 8:02pm UTC](https://forums.digi.com/t/searching-directory/10934 "2009-04-08T20:02:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kspang](https://avatars.discourse-cdn.com/v4/letter/k/919ad9/32.png) [@kspang](https://forums.digi.com/u/kspang)\
**Post date:** [April 8, 2009, 8:02pm UTC](https://forums.digi.com/t/searching-directory/10934/1 "2009-04-08T20:02:37Z")

</div>

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.

Code:  
//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?
