FAT.LIB line 4288 error

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 ) {
printf("fat_EnumPartition: Partition %d is not a FAT Partition.
", pnum);
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?