lotus

previous page: 06.019 What information is included in the DOS 3.3 VTOC and catalog sectors?
  
page up: Apple II Csa2 FAQs
  
next page: 06.021 What are the formats of DOS 3.3's main file types?

06.020 How does DOS 3.3 remember which sectors are used to store a file?




Description

This article is from the Apple II Csa2 FAQ, by Jeff Hurlburt with numerous contributions by others.

06.020 How does DOS 3.3 remember which sectors are used to store a file?

         Every file has a set of one or more Track/Sector List sectors. A Track/
Sector List (T/S List) lists sectors (by Track and Sector number) which make up
the file.  Each T/S List sector points to up to 122 data sectors If the file is
too long for one T/S List sector, a second one is allocated, and a pointer to
it is stored in the first one, and so on.

     Note that DOS 3.3 supports "sparse" files...there may 0/0 pairs in the T/
S List indicating parts of the file that were never written. When DOS 3.3 is
reading a file and encounters a 0/0 pair in the T/S List, it passes a buffer
full of binary zeros back to the calling program.

     A Track/Sector List sector looks like this:

Byte   Meaning
----   -------
$00    Unused
$01-02 Track/Sector location of next T/S List sector (00 for Track means
       the list uses no more sectors since Track 0 can not be used)
$03-04 Unused
$05-06 Sector number in file (offset) of first sector represented in this
       T/S List sector (starting at byte $0C below).
       Ex: 00 00 = file sector #0 (i.e. the sector specified is the first
       sector in the file).  In a second T/S list sector, if required,
       the first sector listed would be file sector #122 (i.e. the 123rd
       sector) indicated by 7A 00-- hexadecimal $007A = 122 in decimal.
$07-0B Unused

The rest of the T/S List sector lists sectors in which the file is stored ...

$0C-0D Track/Sector location of first sector (in this T/S List sector)

$0E-0F Track/Sector location of second sector (in this T/S List sector)

 ... etc.

---------------------------
    

 

Continue to:













TOP
previous page: 06.019 What information is included in the DOS 3.3 VTOC and catalog sectors?
  
page up: Apple II Csa2 FAQs
  
next page: 06.021 What are the formats of DOS 3.3's main file types?