# FAT.LIB line 4288 error

**URL:** <https://forums.digi.com/t/fat-lib-line-4288-error/9880>\
**Category:** Rabbit\
**Created:** [May 4, 2007, 10:42pm UTC](https://forums.digi.com/t/fat-lib-line-4288-error/9880 "2007-05-04T22:42:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![printf](https://avatars.discourse-cdn.com/v4/letter/p/c68b51/32.png) [@printf](https://forums.digi.com/u/printf)\
**Post date:** [May 4, 2007, 10:42pm UTC](https://forums.digi.com/t/fat-lib-line-4288-error/9880/1 "2007-05-04T22:42:43Z")

</div>

I’m bringing up an SD card data storage with a rabbit using ZW FAT library and SHDesigns MMC (SD card I/O) library. I’m able to format, and write a file to the SD card that is readable with my PC. I can also read the file with the rabbit but only once per reset - if I try to read the same file again (without restarting the program) I get nothing back (clue #1?).

I get an errors 302 or 303 from FAT.LIB line 2288 every time I read successful or not, saying partition 0 is O-K but partition 1 and 2 are not FAT partitions (clue #2?):

if ( fat\_IsFatMBREntry(dev-\>part[pnum].parttype) == 0 ) {  
#ifdef FAT\_VERBOSE  
printf("fat\_EnumPartition: Partition %d is not a FAT Partition.  
", pnum);  
#endif  
return (dev-\>part[pnum].parttype ? -EBADPART : -ENOPART);  
}

The strategy I took with this is for each operation, write or read, I mount the card, open the file, do the operation, close the file, unmount the card. My meaning is, there’s nothing I do special on program startup, no init - it seems that it works only once after startup but I can’t figure out why. This being the first FAT operation I’ve worked with I wonder if someone here has any ideas?

So I more or less modified the FAT\_SHELL.C sample code to create this code. It also gives me the same errors about partition 1 and 2 and that partition 0 is O-K.

I found and was able to fix all this by commenting out FAT.LIB line 3730 (clue #3):

if (\*temppartlist) {  
// don’t do anything more if partition is currently mounted OK  
// line 3730 commented out by ME - continue;  
}

I’d found it wouldn’t get to the reading the file part if that continue executed. I’m unmounting everything after doing my operation - does any FAT.LIB guru know what I’m doing wrong? Will leaving line 3730 commented out have any bad effects?

Thanks!  
Chris
