Re: SD2IEC REL support

From: Jim Brain <brain_at_jbrain.com>
Date: Sat, 1 Feb 2020 18:34:05 -0600
Message-ID: <9ec60d93-6be6-e81a-cd80-8e7465428d17_at_jbrain.com>
On 2/1/2020 6:10 AM, silverdr_at_wfmh.org.pl wrote:
>
>
>>> Actually it's not simply opening the file. It is when creating new file (with content) by positioning record pointer beyond the end. This causes 50, RECORD NOT PRESENT and expands the file accordingly.
> This is when DOS returns 50 on floppy drives and also on IDE64, which supports flattned REL files.

I misunderstood your earlier response then.  I do handle that, in 
fatops.c:fat_file_seek:

   if (buf->pvt.fat.fh.fsize >= pos) {
     FRESULT res = f_lseek(&buf->pvt.fat.fh, pos);
     if (res != FR_OK) {
       parse_error(res,0);
       f_close(&buf->pvt.fat.fh);
       free_buffer(buf);
       return 1;
     }

     if (fat_file_read(buf))
       return 1;
   } else {
     buf->data[2]  = (buf->recordlen ? 255:13);
     buf->lastused = 2;
     buf->fptr     = position;
     set_error(ERROR_RECORD_MISSING);
   }


Essentially, if the size is smaller that the position being requested, 
it puts the position there and returns the error.

Jim
Received on 2020-05-30 00:42:28

Archive generated by hypermail 2.3.0.