To use this file copy and paste this:
// #URL-lib "http://pin1.org/forthlib/flb/SD-Card/fat-3.flb" into BV Terminal 3
or here to download.
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// FAT formmatted SD card access
// ========== P A R T 3 ======================================
// This section is for reading existing files on the card
// it also has the beginnings of operastions with the FAT that
// is also necessary for writing. This file introduces logical
// sectors, sectors within files rather then physical sectors on
// the card.
// This shares many words with fat-1-a and fat-2 so it should
// have the same SID number
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// HISTORY:
// Mar 2008 * found extra ; in f.open - removed
// REQUIRES:
// #URL-Inc "http://pin1.org/forthlib/flb/General/soft1.flb" sid=99
// #URL-lib "http://pin1.org/forthlib/flb/General/pinsel.flb" sid=100
// #URL-lib "http://pin1.org/forthlib/flb/General/SPI.flb" sid=101
// #URL-lib "http://pin1.org/forthlib/flb/SD-Card/MMC.flb" sid=102
// #URL-lib "http://pin1.org/forthlib/flb/SD-Card/fat-1.flb"
// #URL-lib "http://pin1.org/forthlib/flb/SD-Card/fat-2.flb"
Full Contents of File
: fatClust 
        2*           
        BytesSec  d  @  u
        FatTable1  d  @  +     
        dup  d-sec  <>  if  Dsec@  else  drop  then
        Dbuff  +           
;
: fatClust@
        fatClust
        word16 
;
: Ls2Phys         
    SectClust  d  @  u
    dirAdd  start-clust@  swap
    ?dup 
    if
        for 
            fatClust@     
            dup  &fff7  >  if  drop  drop  -1  unloop  escape  then     
        next
    then   
    SectClust  d  @  *     
    +                         
    fileSpace  d  @    + 
;       
: r-open
    =>  f#         
    dir-search   
    if
        dup  en#  f  !         
        dir-entry  dirEntry  f  32  move   
        d-sec  dirSec  f  !   
        -1  isOpen  f  !       
        d#  device  f  !     
        0    EOF  f  !         
        0  error
    else
        20  error
        0  IsOpen  f  !
    then
;               
: r-random 
    swap  =>  f#
    Ls2Phys     
    dup  0  <  if  drop  -1  else  sec@  0  then
;   
: <0>f.open
    dup  0  devices  between
    if 
        r-open  error#  0=   
    else
        drop  drop
        ."  Handle  value  wrong  "
    then
;           
: <0>f.rrandom   
    r-random  ;
: <0>f.fileSize   
    =>  f#  dirAdd  filesize@  bytessec  d  @ 
;
: <0>f.size  =>  f#  dirAdd  fileSize@  ; 
: <0>f.fb  =>  f#  fatb  ;