Posted: Mon Jul 11, 2011 12:35 pm Post subject: Bugs and solutions - new and historic
There is a v1.0 bug in Sdcreatefileordir:. Add the two lines (at about row 1400) I have highlighted below:
Code:
' An available (previously erased) directory entry or EOD End Of Directory marker found ' Sddirclusterd, Sddirsecincluster, and Sddirbufferpos now point to this directory entry If Sdstatus =28Or Sdstatus =32Then' Free directory entry found
Sdstatus =0' Remap Sdstatus
' Find free FAT1 entry and store position in Sdfatsectornum, and Sdfatbufferpos plus Sdfatclusterd
Sdsectord = Sdfatsectornum ' Continue looking in the same FAT sector
Sdbufferpos = Sdfatbufferpos
Gosub Sdfindfreefat
If Sdstatus =0Then
Gosub Sdlocatedirsector ' Point to the available directory entry again
Sdsectord = Sdsectord + Sddirsecincluster '<--- new line Decr Sdsectord '<--- new line
This doesn't really qualify as a bug, but please note that you must make sure to set Sdstatus to 0 before calling Sdreadfsinfo or Sdwritefsinfo.
Otherwise, you will have a timeout problem after Sddirlistdelete, that ends with Sdstatus being 31 when successful. (Most other routines end with Sdstatus being 0 when successful.)
Please make sure to initialize all variables before starting a new file operation. Many thanks to Benoit for reporting the below:
"sdeof must be set to 0. sdbytesread must be set to 0 at the begining otherwise when you reenter the file eof is directly set to 1 because sdbyteread not reseted and file end is reached."
This affects Example_FIND_READ_FILE and Example_DIRLIST_READ_FILE (and possibly also other examples).
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum