<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://fileformats.archiveteam.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://fileformats.archiveteam.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Bjc2406</id>
		<title>Just Solve the File Format Problem - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://fileformats.archiveteam.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Bjc2406"/>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/Special:Contributions/Bjc2406"/>
		<updated>2026-04-10T05:07:39Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.19.2</generator>

	<entry>
		<id>http://fileformats.archiveteam.org/wiki/ProDOS_file_system</id>
		<title>ProDOS file system</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/wiki/ProDOS_file_system"/>
				<updated>2013-12-13T19:10:57Z</updated>
		
		<summary type="html">&lt;p&gt;Bjc2406: Description of ProDOS 8 filesystem copied from ProDOS 8 Technical Manual Appendix B.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''Copied from manual [http://http://www.easy68k.com/paulrsm/6502/PDOS8TRM.HTM#B here]. Needs formatting edits''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B.1 - Format of Information on a Volume&lt;br /&gt;
When a volume is formatted for use with ProDOS, its surface is&lt;br /&gt;
partitioned into an array of tracks and sectors. In accessing a volume,&lt;br /&gt;
ProDOS requests not a track and sector, but a logical block from the&lt;br /&gt;
device corresponding to that volume. That device's driver translates the&lt;br /&gt;
requested block number into the proper track and sector number; the&lt;br /&gt;
physical location of information on a volume is unimportant to ProDOS&lt;br /&gt;
and to a system program that uses ProDOS. This appendix discusses&lt;br /&gt;
the organization of information on a volume in terms of logical blocks,&lt;br /&gt;
numbered starting with zero, not tracks and sectors.&lt;br /&gt;
&lt;br /&gt;
When the volume is formatted, information needed by ProDOS is&lt;br /&gt;
placed in specific logical blocks. A loader program is placed in&lt;br /&gt;
blocks 0 and 1 of the volume. This program enables ProDOS to be&lt;br /&gt;
booted from the volume. Block 2 of the volume is the key block (the&lt;br /&gt;
first block) of the volume directory file; it contains descriptions of&lt;br /&gt;
(and pointers to) all the files in the volume directory. The volume&lt;br /&gt;
directory occupies a number of consecutive blocks, typically four, and&lt;br /&gt;
is immediately followed by the volume bit map, which records&lt;br /&gt;
whether each block on the volume is used or unused. The volume bit&lt;br /&gt;
map occupies consecutive blocks, one for every 4,096 blocks, or fraction&lt;br /&gt;
thereof, on the volume. The rest of the blocks on the disk contain&lt;br /&gt;
subdirectory file information, standard file information, or are empty.&lt;br /&gt;
The first blocks of a volume look something like Figure B-1.&lt;br /&gt;
&lt;br /&gt;
Page 146&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure B-1. Blocks on a Volume&lt;br /&gt;
&lt;br /&gt;
 +-----------------------------------   ----------------------------------   -------------------&lt;br /&gt;
 |         |         |   Block 2   |     |   Block n    |  Block n + 1  |     |    Block p    |&lt;br /&gt;
 | Block 0 | Block 1 |   Volume    | ... |    Volume    |    Volume     | ... |    Volume     | Other&lt;br /&gt;
 | Loader  | Loader  |  Directory  |     |  Directory   |    Bit Map    |     |    Bit Map    | Files&lt;br /&gt;
 |         |         | (Key Block) |     | (Last Block) | (First Block) |     | (Last Block)  |&lt;br /&gt;
 +-----------------------------------   ----------------------------------   -------------------&lt;br /&gt;
&lt;br /&gt;
The precise format of the volume directory, volume bit map,&lt;br /&gt;
subdirectory files and standard files are explained in the following&lt;br /&gt;
sections.&lt;br /&gt;
&lt;br /&gt;
B.2 - Format of Directory Files&lt;br /&gt;
The format of the information contained in volume directory and&lt;br /&gt;
subdirectory files is quite similar. Each consists of a key block&lt;br /&gt;
followed by zero or more blocks of additional directory information. The&lt;br /&gt;
fields in a directory's key block are: a pointer to the next block in the&lt;br /&gt;
drectory; a header entry that describes the directory; a number of file&lt;br /&gt;
entries describing, and pointing to, the files in that directory; and zero&lt;br /&gt;
or more unused bytes. The fields in subsequent (non-key) blocks in a&lt;br /&gt;
directory are: a number of entries describing, and pointing to, the files&lt;br /&gt;
in that directory; and zero or more unused bytes. The format of a&lt;br /&gt;
directory file is represented in Figure B-2.&lt;br /&gt;
&lt;br /&gt;
Page 147&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure B-2. Directory File Format&lt;br /&gt;
&lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
           Key Block    Any Block         Last Block&lt;br /&gt;
         / +-------+    +-------+         +-------+&lt;br /&gt;
        |  |   0   |&amp;lt;---|Pointer|&amp;lt;--...&amp;lt;--|Pointer|                         Blocks of a directory:&lt;br /&gt;
        |  |-------|    |-------|         |-------|     Not necessarily contiguous,&lt;br /&gt;
        |  |Pointer|---&amp;gt;|Pointer|--&amp;gt;...--&amp;gt;|   0   |     linked by pointers.&lt;br /&gt;
        |  |-------|    |-------|         |-------|&lt;br /&gt;
        |  |Header |    | Entry |   ...   | Entry |&lt;br /&gt;
        |  |-------|    |-------|         |-------|                         Header describes the&lt;br /&gt;
        |  | Entry |    | Entry |   ...   | Entry |     directory file and its&lt;br /&gt;
        |  |-------|    |-------|         |-------|     contents.&lt;br /&gt;
  One  /   / More  /    / More  /         / More  /&lt;br /&gt;
 Block \   /Entries/    /Entries/         /Entries/&lt;br /&gt;
        |  |-------|    |-------|         |-------|                         Entry describes&lt;br /&gt;
        |  | Entry |    | Entry |   ...   | Entry |     and points to a file&lt;br /&gt;
        |  |-------|    |-------|         |-------|     (subdirectory or&lt;br /&gt;
        |  | Entry |    | Entry |   ...   | Entry |     standard) in that&lt;br /&gt;
        |  |-------|    |-------|         |-------|     directory.&lt;br /&gt;
        |  |Unused |    |Unused |   ...   |Unused |&lt;br /&gt;
         \ +-------+    +-------+         +-------+&lt;br /&gt;
&lt;br /&gt;
The header entry is the same length as all other entries. The only&lt;br /&gt;
organizational difference between a volume directory file and a&lt;br /&gt;
subdirectory file is in the header.&lt;br /&gt;
&lt;br /&gt;
See the sections &amp;quot;Volume Directory&lt;br /&gt;
Headers&amp;quot; and &amp;quot;Subdirectory Headers.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
B.2.1 Pointer Fields&lt;br /&gt;
The first four bytes of each block used by a directory file contain&lt;br /&gt;
pointers to the preceding and succeeding blocks in the directory file,&lt;br /&gt;
respectively. Each pointer is a two-byte logical block number, low byte&lt;br /&gt;
first, high byte second. The key block of a directory file has no&lt;br /&gt;
preceding block: its first pointer is zero. Likewise, the last block in a&lt;br /&gt;
directory file has no successor: its second pointer is zero.&lt;br /&gt;
&lt;br /&gt;
By the Way: All block pointers used by ProDOS have the same format:&lt;br /&gt;
low byte first, high byte second.&lt;br /&gt;
&lt;br /&gt;
B.2.2 - Volume Directory Headers&lt;br /&gt;
Block 2 of a volume is the key block of that volume's directory file.&lt;br /&gt;
The volume directory header is at byte position $0004 of the key block,&lt;br /&gt;
immediately following the block's two pointers. Thirteen fields are&lt;br /&gt;
currently defined to be in a volume directory header: they contain all&lt;br /&gt;
the vital information about that volume. Figure B-3 illustrates the&lt;br /&gt;
structure of a volume directory header. Following Figure B-3 is a&lt;br /&gt;
description of each of its fields.&lt;br /&gt;
&lt;br /&gt;
Page 148&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure B-3. The Volume Directory Header&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
   &lt;br /&gt;
   &lt;br /&gt;
   &lt;br /&gt;
   &lt;br /&gt;
    Field                                Byte of&lt;br /&gt;
   Length                                Block&lt;br /&gt;
          +----------------------------+&lt;br /&gt;
  1 byte  | storage_type | name_length | $04&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
          |                            | $05&lt;br /&gt;
          /                            /    &lt;br /&gt;
 15 bytes /        file_name           /&lt;br /&gt;
          |                            | $13&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
          |                            | $14&lt;br /&gt;
          /                            /&lt;br /&gt;
  8 bytes /          reserved          /&lt;br /&gt;
          |                            | $1B&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
          |                            | $1C&lt;br /&gt;
          |          creation          | $1D&lt;br /&gt;
  4 bytes |        date &amp;amp; time         | $1D&lt;br /&gt;
          |                            | $1F&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
  1 byte  |          version           | $20&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
  1 byte  |        min_version         | $21&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
  1 byte  |           access           | $22&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
  1 byte  |        entry_length        | $23&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
  1 byte  |     entries_per_block      | $24&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
          |                            | $25&lt;br /&gt;
  2 bytes |         file_count         | $26&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
          |                            | $27&lt;br /&gt;
  2 bytes |      bit_map_pointer       | $28&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
          |                            | $29&lt;br /&gt;
  2 bytes |        total_blocks        | $2A&lt;br /&gt;
          +----------------------------+&lt;br /&gt;
&lt;br /&gt;
Page 149&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
storage_type and name_length (1 byte): Two four-bit fields are&lt;br /&gt;
packed into this byte. A value of $F in the high four bits (the&lt;br /&gt;
storage_type) identifies the current block as the key block of a volume&lt;br /&gt;
directory file. The low four bits contain the length of the volume's&lt;br /&gt;
name (see the file_name field, below). The name_length can be&lt;br /&gt;
changed by a RENAME call.&lt;br /&gt;
&lt;br /&gt;
file_name (15 bytes): The first n bytes of this field, where n is&lt;br /&gt;
specified by name_length, contain the volume's name. This name must&lt;br /&gt;
conform to the filename (volume name) syntax explained in Chapter 2.&lt;br /&gt;
The name does not begin with the slash that usually precedes volume&lt;br /&gt;
names. This field can be changed by the RENAME call.&lt;br /&gt;
&lt;br /&gt;
reserved (8 bytes): Reserved for future expansion of the file system.&lt;br /&gt;
&lt;br /&gt;
creation (4 bytes): The date and time at which this volume was&lt;br /&gt;
initialized. The format of these bytes is described in Section B.4.2.2.&lt;br /&gt;
&lt;br /&gt;
version (1 byte): The version number of ProDOS under which this&lt;br /&gt;
volume was initialized. This byte allows newer versions of ProDOS to&lt;br /&gt;
determine the format of the volume, and adjust their directory&lt;br /&gt;
interpretation to conform to older volume formats. In ProDOS 1.0,&lt;br /&gt;
version = 0.&lt;br /&gt;
&lt;br /&gt;
min_version: Reserved for future use. In ProDOS 1.0, it is 0.&lt;br /&gt;
&lt;br /&gt;
access (1 byte): Determines whether this volume directory can be read&lt;br /&gt;
written, destroyed, and renamed. The format of this field is described&lt;br /&gt;
in Section B.4.2.3.&lt;br /&gt;
&lt;br /&gt;
entry_length (1 byte): The length in bytes of each entry in this&lt;br /&gt;
directory. The volume directory header itself is of this length.&lt;br /&gt;
entry_length = $27.&lt;br /&gt;
&lt;br /&gt;
entries_per_block (1 byte): The number of entries that are stored in&lt;br /&gt;
each block of the directory file. entries_per_block = $0D.&lt;br /&gt;
&lt;br /&gt;
file_count (2 bytes): The number of active file entries in this&lt;br /&gt;
directory file. An active file is one whose storage_type is not 0. See&lt;br /&gt;
Section B.2.4 for a description of file entries.&lt;br /&gt;
&lt;br /&gt;
bit_map_pointer (2 bytes): The block address of the first block of&lt;br /&gt;
the volume's bit map. The bit map occupies consecutive blocks, one for&lt;br /&gt;
every 4,096 blocks (or fraction thereof) on the volume. You can&lt;br /&gt;
calculate the number of blocks in the bit map using the total_blocks&lt;br /&gt;
field, described below.&lt;br /&gt;
&lt;br /&gt;
Page 150&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The bit map has one bit for each block on the volume: a value of 1&lt;br /&gt;
means the block is free; 0 means it is in use. If the number of blocks&lt;br /&gt;
used by all files on the volume is not the same as the number&lt;br /&gt;
recorded in the bit map, the directory structure of the volume has been&lt;br /&gt;
damaged.&lt;br /&gt;
&lt;br /&gt;
total_blocks (2 bytes): The total number of blocks on the volume.&lt;br /&gt;
&lt;br /&gt;
B.2.3 - Subdirectory Headers&lt;br /&gt;
The key block of every subdirectory file is pointed to by an entry in a&lt;br /&gt;
parent directory; for example, by an entry in a volume directory&lt;br /&gt;
(explained in Section B.2). A subdirectory's header begins at byte&lt;br /&gt;
position $0004 of the key block of that subdirectory file, immediately&lt;br /&gt;
following the two pointers.&lt;br /&gt;
&lt;br /&gt;
Its internal structure is quite similar to that of a volume directory&lt;br /&gt;
header. Fourteen fields are currently defined to be in a subdirectory.&lt;br /&gt;
Figure B-4 illustrates the structure of a subdirectory header. A&lt;br /&gt;
description of all the fields in a subdirectory header follows Figure B-4.&lt;br /&gt;
&lt;br /&gt;
Page 151&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure B-4. The Subdirectory Header&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
   &lt;br /&gt;
   &lt;br /&gt;
   &lt;br /&gt;
   &lt;br /&gt;
    Field                                Byte of&lt;br /&gt;
   Length                                Block&lt;br /&gt;
          +----------------------------+&lt;br /&gt;
  1 byte  | storage_type | name_length | $04&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
          |                            | $05&lt;br /&gt;
          /                            /&lt;br /&gt;
 15 bytes /         file_name          /&lt;br /&gt;
          |                            | $13&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
          |                            | $14&lt;br /&gt;
          /                            /&lt;br /&gt;
  8 bytes /          reserved          /&lt;br /&gt;
          |                            | $1B&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
          |                            | $1C&lt;br /&gt;
          |          creation          | $1D&lt;br /&gt;
  4 bytes |        date &amp;amp; time         | $1D&lt;br /&gt;
          |                            | $1F&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
  1 byte  |          version           | $20&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
  1 byte  |        min_version         | $21&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
  1 byte  |           access           | $22&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
  1 byte  |        entry_length        | $23&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
  1 byte  |     entries_per_block      | $24&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
          |                            | $25&lt;br /&gt;
  2 bytes |         file_count         | $26&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
          |                            | $27&lt;br /&gt;
  2 bytes |       parent_pointer       | $28&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
  1 byte  |    parent_entry_number     | $29&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
  1 byte  |    parent_entry_length     | $2A&lt;br /&gt;
          +----------------------------+&lt;br /&gt;
&lt;br /&gt;
Page 152&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
storage_type and name_length (1 byte): Two four-bit fields are&lt;br /&gt;
packed into this byte. A value of $E in the high four bits (the&lt;br /&gt;
storage_type) identifies the current block as the key block of a&lt;br /&gt;
subdirectory file. The low four bits contain the length of the&lt;br /&gt;
subdirectory's name (see the file_name field, below). The&lt;br /&gt;
name_length can be changed by a RENAME call.&lt;br /&gt;
&lt;br /&gt;
file_name (15 bytes): The first name_length bytes of this field&lt;br /&gt;
contain the subdirectory's name. This name must conform to the&lt;br /&gt;
filename syntax explained in Chapter 2. This field can be changed by&lt;br /&gt;
the RENAME call.&lt;br /&gt;
&lt;br /&gt;
reserved (8 bytes): Reserved for future expansion of the file system.&lt;br /&gt;
&lt;br /&gt;
creation (4 bytes): The date and time at which this subdirectory was&lt;br /&gt;
created. The format of these bytes is described in Section B.4.2.2.&lt;br /&gt;
&lt;br /&gt;
version (1 byte): The version number of ProDOS under which this&lt;br /&gt;
subdirectory was created. This byte allows newer versions of ProDOS&lt;br /&gt;
to determine the format of the subdirectory, and to adjust their&lt;br /&gt;
directory interpretations accordingly. ProDOS 1.0: version = 0.&lt;br /&gt;
&lt;br /&gt;
min_version (1 byte): The minimum version number of ProDOS that&lt;br /&gt;
can access the information in this subdirectory. This byte allows older&lt;br /&gt;
versions of ProDOS to determine whether they can access newer&lt;br /&gt;
subdirectories. min_version = 0.&lt;br /&gt;
&lt;br /&gt;
access (1 byte): Determines whether this subdirectory can be read,&lt;br /&gt;
written, destroyed, and renamed, and whether the file needs to be&lt;br /&gt;
backed up. The format of this field is described in Section B.4.2.3. A&lt;br /&gt;
subdirectory's access byte can be changed by the SET_FILE_INFO&lt;br /&gt;
call.&lt;br /&gt;
&lt;br /&gt;
entry_length (1 byte): The length in bytes of each entry in this&lt;br /&gt;
subdirectory. The subdirectory header itself is of this length.&lt;br /&gt;
entry_length = $27.&lt;br /&gt;
&lt;br /&gt;
entries_per_block (1 byte): The number of entries that are stored in&lt;br /&gt;
each block of the directory file. entries_per_block = $0D.&lt;br /&gt;
&lt;br /&gt;
file_count (2 bytes): The number of active file entries in this&lt;br /&gt;
subdirectory file. An active file is one whose storage_type is not 0. See&lt;br /&gt;
Section &amp;quot;File Entries&amp;quot; for more information about file entries.&lt;br /&gt;
&lt;br /&gt;
parent_pointer (2 bytes): The block address of the directory file block&lt;br /&gt;
that contains the entry for this subdirectory. This two-byte pointer is&lt;br /&gt;
stored low byte first, high byte second.&lt;br /&gt;
&lt;br /&gt;
Page 153&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
parent_entry_number (1 byte): The entry number for this&lt;br /&gt;
subdirectory within the block indicated by parent_pointer.&lt;br /&gt;
&lt;br /&gt;
parent_entry_length (1 byte): The entry_length for the directory&lt;br /&gt;
that owns this subdirectory file. Note that with these last three fields&lt;br /&gt;
you can calculate the precise position on a volume of this&lt;br /&gt;
subdirectory's file entry. parent_entry_length = $27.&lt;br /&gt;
&lt;br /&gt;
B.2.4 - File Entries&lt;br /&gt;
Immediately following the pointers in any block of a directory file are&lt;br /&gt;
a number of entries. The first entry in the key block of a directory file&lt;br /&gt;
is a header; all other entries are file entries. Each entry has the length&lt;br /&gt;
specified by that directory's entry_length field, and each file entry&lt;br /&gt;
contains information that describes, and points to, a single subdirectory&lt;br /&gt;
file or standard file.&lt;br /&gt;
&lt;br /&gt;
An entry in a directory file may be active or inactive; that is, it may&lt;br /&gt;
or may not describe a file currently in the directory. If it is inactive,&lt;br /&gt;
the first byte of the entry (storage_type and name_length) has the&lt;br /&gt;
value zero.&lt;br /&gt;
&lt;br /&gt;
The maximum number of entries, including the header, in a block of a&lt;br /&gt;
directory is recorded in the entries_per_block field of that directory's&lt;br /&gt;
header. The total number of active file entries, not including the&lt;br /&gt;
header, is recorded in the file_count field of that directory's header.&lt;br /&gt;
&lt;br /&gt;
Figure B-5 describes the format of a file entry.&lt;br /&gt;
&lt;br /&gt;
Page 154&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure B-5. The File Entry&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
   &lt;br /&gt;
   &lt;br /&gt;
   &lt;br /&gt;
   &lt;br /&gt;
    Field                                Entry&lt;br /&gt;
   Length                                Offset&lt;br /&gt;
          +----------------------------+&lt;br /&gt;
  1 byte  | storage_type | name_length | $00&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
          |                            | $01&lt;br /&gt;
          /                            /&lt;br /&gt;
 15 bytes /         file_name          /&lt;br /&gt;
          |                            | $0F&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
  1 byte  |         file_type          | $10&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
          |                            | $11&lt;br /&gt;
  2 bytes |        key_pointer         | $12&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
          |                            | $13&lt;br /&gt;
  2 bytes |        blocks_used         | $14&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
          |                            | $15&lt;br /&gt;
  3 bytes |            EOF             |&lt;br /&gt;
          |                            | $17&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
          |                            | $18&lt;br /&gt;
          |          creation          |&lt;br /&gt;
  4 bytes |        date &amp;amp; time         |&lt;br /&gt;
          |                            | $1B&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
  1 byte  |          version           | $1C&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
  1 byte  |        min_version         | $1D&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
  1 byte  |           access           | $1E&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
          |                            | $1F&lt;br /&gt;
  2 bytes |          aux_type          | $20&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
          |                            | $21&lt;br /&gt;
          |                            |&lt;br /&gt;
  4 bytes |          last mod          |&lt;br /&gt;
          |                            | $24&lt;br /&gt;
          |----------------------------|&lt;br /&gt;
          |                            | $25&lt;br /&gt;
  2 bytes |       header_pointer       | $26&lt;br /&gt;
          +----------------------------+&lt;br /&gt;
&lt;br /&gt;
Page 155&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
storage_type and name_length (1 byte): Two four-bit fields are&lt;br /&gt;
packed into this byte. The value in the high-order four bits (the&lt;br /&gt;
storage_type) specifies the type of file pointed to by this file entry:&lt;br /&gt;
&lt;br /&gt;
$1 = Seeding file&lt;br /&gt;
$2 = Sapling file&lt;br /&gt;
$3 = Tree file&lt;br /&gt;
$4 = Pascal area&lt;br /&gt;
$D = Subdirectory&lt;br /&gt;
&lt;br /&gt;
Seedling, sapling, and tree files, the three forms of a standard file, are&lt;br /&gt;
described in Section B.3. The low four bits contain the length of the&lt;br /&gt;
file's name (see the file_name field, below). The name_length can be&lt;br /&gt;
changed by a RENAME call.&lt;br /&gt;
&lt;br /&gt;
file_name (15 bytes): The first name_length bytes of this field&lt;br /&gt;
contain the file's name. This name must conform to the filename&lt;br /&gt;
syntax explained in Chapter 2. This field can be changed by the&lt;br /&gt;
RENAME call.&lt;br /&gt;
&lt;br /&gt;
file_type (1 byte): A descriptor of the internal structure of the file.&lt;br /&gt;
Section B.4.2.4 contains a list of the currently defined values of this&lt;br /&gt;
byte.&lt;br /&gt;
&lt;br /&gt;
key_pointer (2 bytes): The block address of the master index block if&lt;br /&gt;
a tree file, of the index block if a sapling file, and of the block if a&lt;br /&gt;
seedling file.&lt;br /&gt;
&lt;br /&gt;
blocks_used (2 bytes): The total number of blocks actually used by&lt;br /&gt;
the file. For a subdirectory file, this includes the blocks containing&lt;br /&gt;
subdirectory information, but not the blocks in the files pointed to. For&lt;br /&gt;
a standard file, this includes both informational blocks (index blocks)&lt;br /&gt;
and data blocks. Refer to Section B.3 for more information on standard&lt;br /&gt;
files.&lt;br /&gt;
&lt;br /&gt;
EOF (3 bytes): A three-byte integer, lowest bytes first, that represents&lt;br /&gt;
the total number of bytes readable from the file. Note that in the case&lt;br /&gt;
of sparse files, described in Section B.3.6, EOF may be greater than the&lt;br /&gt;
number of bytes actually allocated on the disk.&lt;br /&gt;
&lt;br /&gt;
creation (4 bytes): The date and time at which the file pointed to by&lt;br /&gt;
this entry was created. The format of these bytes is described in&lt;br /&gt;
Section B.4.2.2.&lt;br /&gt;
&lt;br /&gt;
version (1 byte): The version number of ProDOS under which the file&lt;br /&gt;
pointed to by this entry was created. This byte allows newer versions&lt;br /&gt;
of ProDOS to determine the format of the file, and adjust their&lt;br /&gt;
interpretation processes accordingly. In ProDOS 1.0, version = 0.&lt;br /&gt;
&lt;br /&gt;
Page 156&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
min_version (1 byte): The minimum version number of ProDOS that&lt;br /&gt;
can access the information in this file. This byte allows older versions&lt;br /&gt;
of ProDOS to determine whether they can access newer files. In&lt;br /&gt;
ProDOS 1.0, min_version = 0.&lt;br /&gt;
&lt;br /&gt;
access (1 byte): Determines whether this file can be read, written,&lt;br /&gt;
destroyed, and renamed, and whether the file needs to be backed up.&lt;br /&gt;
The format of this field is described in Section B.4.2.3. The value of&lt;br /&gt;
this field can be changed by the SET_FILE_INFO call. You cannot&lt;br /&gt;
delete a subdirectory that contains any files.&lt;br /&gt;
&lt;br /&gt;
aux_type (2 bytes): A general-purpose field in which a system&lt;br /&gt;
program can store additional information about the internal format of a&lt;br /&gt;
file. For example, the ProDOS BASIC system program uses this field to&lt;br /&gt;
record the load address of a BASIC program or binary file, or the&lt;br /&gt;
record length of a text file.&lt;br /&gt;
&lt;br /&gt;
last_mod (4 bytes): The date and time that the last CLOSE operation&lt;br /&gt;
after a WRITE was performed on this file. The format of these bytes is&lt;br /&gt;
described in Section B.4.2.2. This field can be changed by the&lt;br /&gt;
SET_FILE_INFO call.&lt;br /&gt;
&lt;br /&gt;
header_pointer (2 bytes): This field is the block address of the key&lt;br /&gt;
block of the directory that owns this file entry. This two-byte pointer is&lt;br /&gt;
stored low byte first, high byte second.&lt;br /&gt;
&lt;br /&gt;
B.2.5 - Reading a Directory File&lt;br /&gt;
This section deals with the techniques of reading from directory files,&lt;br /&gt;
not with the specifics. The ProDOS calls with which these techniques&lt;br /&gt;
can be implemented are explained in Chapter 4.&lt;br /&gt;
&lt;br /&gt;
Before you can read from a directory, you must know the directory's&lt;br /&gt;
pathname. With the directory's pathname, you can open the directory&lt;br /&gt;
file, and obtain a reference number (RefNum) for that open file.&lt;br /&gt;
Before you can process the entries in the directory, you must read&lt;br /&gt;
three values from the directory header:&lt;br /&gt;
&lt;br /&gt;
the length of each entry in the directory (entry_length) &lt;br /&gt;
the number of entries in each block of the directory&lt;br /&gt;
(entries_per_block) &lt;br /&gt;
the total number of files in the directory (file_count). &lt;br /&gt;
Page 157&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the reference number to identify the file, read the first 512 bytes&lt;br /&gt;
from the file, and into a buffer (ThisBlock). The buffer contains&lt;br /&gt;
two two-byte pointers, followed by the entries; the first entry is the&lt;br /&gt;
directory header. The three values are at positions $1F through $22 in&lt;br /&gt;
the header (positions $23 through $26 in the buffer). In the example&lt;br /&gt;
below, these values are assigned to the variables EntryLength,&lt;br /&gt;
EntriesPerBlock, and FileCount.&lt;br /&gt;
&lt;br /&gt;
 Open(DirPathname, Refnum);               {Get reference number    }&lt;br /&gt;
 ThisBlock       := Read512Bytes(RefNum); {Read a block into buffer}&lt;br /&gt;
 EntryLength     := ThisBlock[$23];       {Get directory info      }&lt;br /&gt;
 EntriesPerBlock := ThisBlock[$24];&lt;br /&gt;
 FileCount       := ThisBlock[$25] + (256 * ThisBlock[$26]);&lt;br /&gt;
&lt;br /&gt;
Once these values are known, a system program can scan through the&lt;br /&gt;
entries in the buffer, using a pointer to the beginning of the current&lt;br /&gt;
entry EntryPointer, a counter BlockEntries that&lt;br /&gt;
indicates the number of entries that have been examined in the&lt;br /&gt;
current block, and a second counter ActiveEntries that&lt;br /&gt;
indicates the number of active entries that have been processed.&lt;br /&gt;
&lt;br /&gt;
An entry is active and is processed only if its first byte, the&lt;br /&gt;
storage_type and name_length, is nonzero. All entries have been&lt;br /&gt;
processed when ActiveEntries is equal to FileCount. If&lt;br /&gt;
all the entries in the buffer have been processed, and&lt;br /&gt;
ActiveEntries doesn't equal FileCount, then the next&lt;br /&gt;
block of the directory is read into the buffer.&lt;br /&gt;
&lt;br /&gt;
 EntryPoint      := EntryLength + $04;         {Skip header entry}&lt;br /&gt;
 BlockEntries    := $02;            {Prepare to process entry two}&lt;br /&gt;
 ActiveEntries   := $00;            {No active entries found yet }&lt;br /&gt;
&lt;br /&gt;
 while ActiveEntries &amp;lt; FileCount do begin&lt;br /&gt;
      if ThisBlock[EntryPointer] &amp;lt;&amp;gt; $00 then begin  {Active entry}&lt;br /&gt;
           ProcessEntry(ThisBlock[EntryPointer]);&lt;br /&gt;
           ActiveEntries := ActiveEntries + $01&lt;br /&gt;
      end;&lt;br /&gt;
      if ActiveEntries &amp;lt; FileCount then  {More entries to process}&lt;br /&gt;
           if BlockEntries = EntriesPerBlock&lt;br /&gt;
                then begin           {ThisBlock done. Do next one}&lt;br /&gt;
                     ThisBlock    := Read512Bytes(RefNum);&lt;br /&gt;
                     BlockEntries := $01;&lt;br /&gt;
                     EntryPointer := $04&lt;br /&gt;
                end&lt;br /&gt;
                else begin           {Do next entry in ThisBlock }&lt;br /&gt;
                     EntryPointer := EntryPointer + EntryLength;&lt;br /&gt;
                     BlockEntries := BlockEntries + $01&lt;br /&gt;
                end&lt;br /&gt;
 end;&lt;br /&gt;
 Close(RefNum);&lt;br /&gt;
&lt;br /&gt;
Page 158&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This algorithm processes entries until all expected active entries have&lt;br /&gt;
been found. If the directory structure is damaged, and the end of the&lt;br /&gt;
directory file is reached before the proper number of active entries has&lt;br /&gt;
been found, the algorithm fails.&lt;br /&gt;
&lt;br /&gt;
B.3 - Format of Standard Files&lt;br /&gt;
Each active entry in a directory file points to the key block (the first&lt;br /&gt;
block) of a file. As shown below, the key block of a standard file may&lt;br /&gt;
have several types of information in it. The storage_type field in that&lt;br /&gt;
file's entry must be used to determine the contents of the key block.&lt;br /&gt;
This section explains the structure of the three stages of standard file:&lt;br /&gt;
seedling, sapling, and tree. These are the files in which all programs&lt;br /&gt;
and data are stored.&lt;br /&gt;
&lt;br /&gt;
B.3.1 - Growing a Tree File&lt;br /&gt;
The following scenario demonstrates the growth of a tree file on a&lt;br /&gt;
volume. This scenario is based on the block allocation scheme used by&lt;br /&gt;
ProDOS 1.0 on a 280-block flexible disk that contains four blocks of&lt;br /&gt;
volume directory, and one block of volume bit map. Larger capacity&lt;br /&gt;
volumes might have more blocks in the volume bit map, but the&lt;br /&gt;
process would be identical.&lt;br /&gt;
&lt;br /&gt;
A formatted, but otherwise empty, ProDOS volume is used like this:&lt;br /&gt;
&lt;br /&gt;
Blocks 0-1 - Loader&lt;br /&gt;
Blocks 2-5 - Volume directory&lt;br /&gt;
Block 6 - Volume bit map&lt;br /&gt;
Blocks 7-279 - Unused&lt;br /&gt;
&lt;br /&gt;
Page 159&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you open a new file of a nondirectory type, one data block is&lt;br /&gt;
immediately allocated to that file. An entry is placed in the volume&lt;br /&gt;
directory, and it points to block 7, the new data block, as the key&lt;br /&gt;
block for the file. The key block is indicated below by an arrow.&lt;br /&gt;
&lt;br /&gt;
The volume now looks like this:&lt;br /&gt;
&lt;br /&gt;
 Data Block 0&lt;br /&gt;
     Blocks 0-1      Loader&lt;br /&gt;
     Blocks 2-5      Volume directory&lt;br /&gt;
     Block 6         Volume bit map&lt;br /&gt;
 --&amp;gt; Block 7         Data block 0&lt;br /&gt;
     Blocks 8-279    Unused&lt;br /&gt;
&lt;br /&gt;
This is a seedling file: its key block contains up to 512 bytes of data.&lt;br /&gt;
If you write more than 512 bytes of data to the file, the file grows&lt;br /&gt;
into a sapling file. As soon as a second block of data becomes&lt;br /&gt;
necessary, an index block is allocated, and it becomes the file's key&lt;br /&gt;
block: this index block can point to up to 256 data blocks (two-byte&lt;br /&gt;
pointers). A second data block (for the data that won't fit in the first&lt;br /&gt;
data block) is also allocated. The volume now looks like this:&lt;br /&gt;
&lt;br /&gt;
 Index Block 0&lt;br /&gt;
 Data Block 0&lt;br /&gt;
 Data Block 1&lt;br /&gt;
     Blocks 0-1      Loader&lt;br /&gt;
     Blocks 2-5      Volume directory&lt;br /&gt;
     Block 6         Volume bit map&lt;br /&gt;
     Block 7         Data block 0&lt;br /&gt;
 --&amp;gt; Block 8         Index block 0&lt;br /&gt;
     Block 9         Data block 1&lt;br /&gt;
     Blocks 10-279   Unused&lt;br /&gt;
&lt;br /&gt;
This sapling file can hold up to 256 data blocks: 128K of data. If the&lt;br /&gt;
file becomes any bigger than this, the file grows again, this time into a&lt;br /&gt;
tree file. A master index block is allocated, and it becomes the file's&lt;br /&gt;
key block: the master index block can point to up to 128 index blocks&lt;br /&gt;
and each of these can point to up to 256 data blocks. Index block G&lt;br /&gt;
becomes the first index block pointed to by the master index block. In&lt;br /&gt;
addition, a new index block is allocated, and a new data block to&lt;br /&gt;
which it points.&lt;br /&gt;
&lt;br /&gt;
Page 160&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here's a new picture of the volume:&lt;br /&gt;
&lt;br /&gt;
 Master Index Block&lt;br /&gt;
 Index Block 0&lt;br /&gt;
 Index Block 1&lt;br /&gt;
 Data Block 0&lt;br /&gt;
 Data Block 255&lt;br /&gt;
 Data Block 256&lt;br /&gt;
     Blocks 0-1      Loader&lt;br /&gt;
     Blocks 2-5      Volume directory&lt;br /&gt;
     Block 6         Volume bit map&lt;br /&gt;
     Block 7         Data block 0&lt;br /&gt;
     Block 8         Index block 0&lt;br /&gt;
     Blocks 9-263    Data blocks 1-255&lt;br /&gt;
 --&amp;gt; Block 264       Master index block&lt;br /&gt;
     Block 265       Index block 1&lt;br /&gt;
     Block 266       Data block 256&lt;br /&gt;
     Blocks 267-279  Unused&lt;br /&gt;
&lt;br /&gt;
As data is written to this file, additional data blocks and index blocks&lt;br /&gt;
are allocated as needed, up to a maximum of 129 index blocks (one a&lt;br /&gt;
master index block), and 32,768 data blocks, for a maximum capacity&lt;br /&gt;
of 16,777,215 bytes of data in a file. If you did the multiplication, you&lt;br /&gt;
probably noticed that a byte was lost somewhere. The last byte of the&lt;br /&gt;
last block of the largest possible file cannot be used because EOF&lt;br /&gt;
cannot exceed 16,777,216. If you are wondering how such a large file&lt;br /&gt;
might fit on a small volume such as a flexible disk, refer to&lt;br /&gt;
Section B.3.6 on sparse files.&lt;br /&gt;
&lt;br /&gt;
This scenario shows the growth of a single file on an otherwise empty&lt;br /&gt;
volume. The process is a bit more confusing when several files are&lt;br /&gt;
growing -- or being deleted -- simultaneously. However, the block&lt;br /&gt;
allocation scheme is always the same: when a new block is needed&lt;br /&gt;
ProDOS always allocates the first unused block in the volume bit map.&lt;br /&gt;
&lt;br /&gt;
B.3.2 Seedling Files&lt;br /&gt;
A seedling file is a standard file that contains no more than 512 data&lt;br /&gt;
bytes ($0 &amp;lt;= EOF &amp;lt;= $200). This file is stored as one block on the&lt;br /&gt;
volume, and this data block is the file's key block.&lt;br /&gt;
&lt;br /&gt;
The structure of such a seedling file appears in Figure B-6.&lt;br /&gt;
&lt;br /&gt;
Page 161&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure B-6. Structure of a Seedling File&lt;br /&gt;
&lt;br /&gt;
 key_pointer ----&amp;gt; +-------+&lt;br /&gt;
                   | Data  | Data Block&lt;br /&gt;
                   | Block | 512 bytes long&lt;br /&gt;
 $0 &amp;lt;= EOF &amp;lt;= $200 +-------+&lt;br /&gt;
&lt;br /&gt;
The file is called a seedling file because, if more than 512 data bytes&lt;br /&gt;
are written to it, it grows into a sapling file, and thence into a tree&lt;br /&gt;
file.&lt;br /&gt;
&lt;br /&gt;
The storage_type field of an entry that points to a seedling file has&lt;br /&gt;
the value $1.&lt;br /&gt;
&lt;br /&gt;
B.3.3 - Sapling Files&lt;br /&gt;
A sapling file is a standard file that contains more than 512 and no&lt;br /&gt;
more than 128K bytes ($200 &amp;lt; EOF &amp;lt;= $20000). A sapling file&lt;br /&gt;
comprises an index block and 1 to 256 data blocks. The index block&lt;br /&gt;
contains the block addresses of the data blocks. See Figure B-7.&lt;br /&gt;
&lt;br /&gt;
Figure B-7. Structure of a Sapling File&lt;br /&gt;
&lt;br /&gt;
 key_pointer ------&amp;gt; +-------------------+&lt;br /&gt;
                     |   |   |   |   |   | Index Block:&lt;br /&gt;
                     |$00 $01     $FE $FF| Up to 256 2-Byte&lt;br /&gt;
                     |-   Index Block   -| Pointers to Data Blocks&lt;br /&gt;
 $0 &amp;lt;= EOF &amp;lt;= $20000 |   |   |   |   |   |&lt;br /&gt;
                     +-------------------+&lt;br /&gt;
                       |   |       |   |&lt;br /&gt;
       +---------------+   |       |   +-------------------+&lt;br /&gt;
       |                   |       |                       |&lt;br /&gt;
       |               +---+       +-------+               |&lt;br /&gt;
       |               |                   |               |&lt;br /&gt;
       v               v                   v               v&lt;br /&gt;
 +-----------+   +-----------+       +-----------+   +-----------+&lt;br /&gt;
 |   Data    |   |   Data    | ..... |   Data    |   |   Data    |&lt;br /&gt;
 | Block $00 |   | Block $01 |       | Block $FE |   | Block $FF |&lt;br /&gt;
 +-----------+   +-----------+       +-----------+   +-----------+&lt;br /&gt;
&lt;br /&gt;
The key block of a sapling file is its index block. ProDOS retrieves&lt;br /&gt;
data blocks in the file by first retrieving their addresses in the index&lt;br /&gt;
block.&lt;br /&gt;
&lt;br /&gt;
The storage_type field of an entry that points to a sapling file has&lt;br /&gt;
the value $2.&lt;br /&gt;
&lt;br /&gt;
Page 162&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B.3.4 - Tree Files&lt;br /&gt;
A tree file contains more than 128K bytes, and less than 16M bytes&lt;br /&gt;
($20000 &amp;lt; EOF &amp;lt; $1000000). A tree file consists of a master index&lt;br /&gt;
block, 1 to 128 index blocks, and 1 to 32,768 data blocks. The master&lt;br /&gt;
index block contains the addresses of the index blocks, and each index&lt;br /&gt;
block contains the addresses of up to 256 data blocks. The structure of&lt;br /&gt;
a tree file is shown in Figure B-8.&lt;br /&gt;
&lt;br /&gt;
Figure B-8. The Structure of a Tree File&lt;br /&gt;
&lt;br /&gt;
      key_pointer ------&amp;gt; +----------------------+&lt;br /&gt;
                          |   |   |      |   |   | Master Index Block:&lt;br /&gt;
                          |- Master Index Block -| Up to 128 2-Byte Pointers&lt;br /&gt;
 $20000 &amp;lt; EOF &amp;lt; $10000000 |   |   |      |   |   | to Index Blocks&lt;br /&gt;
                          +----------------------+&lt;br /&gt;
                            |                  |&lt;br /&gt;
               +------------+                +-+&lt;br /&gt;
               |                             |&lt;br /&gt;
               v                             v&lt;br /&gt;
             +-------------------+         +-------------------+&lt;br /&gt;
             |   |   |   |   |   |         |   |   |   |   |   |&lt;br /&gt;
             |- Index Block $00 -| ....... |- Index Block $7F -|&lt;br /&gt;
             |   |   |   |   |   |         |   |   |   |   |   |&lt;br /&gt;
             +-------------------+         +-------------------+&lt;br /&gt;
               |               |             |               |&lt;br /&gt;
     +---------+        +------+            ++               ++&lt;br /&gt;
     |                  |                   |                 |&lt;br /&gt;
     v                  v                   v                 v&lt;br /&gt;
   +-----------+      +-----------+       +-----------+     +-----------+&lt;br /&gt;
   |   Data    | .... |   Data    |       |   Data    | ... |   Data    |&lt;br /&gt;
   | Block $00 |      | Block $FF |       | Block $00 |     | Block $FF |&lt;br /&gt;
   +-----------+      +-----------+       +-----------+     +-----------+&lt;br /&gt;
&lt;br /&gt;
The key block of a tree file is the master index block. By looking at&lt;br /&gt;
the master index block, ProDOS can find the addresses of all the index&lt;br /&gt;
blocks; by looking at those blocks, it can find the addresses of all the&lt;br /&gt;
data blocks.&lt;br /&gt;
&lt;br /&gt;
The storage_type field of an entry that points to a tree file has the&lt;br /&gt;
value $3.&lt;br /&gt;
&lt;br /&gt;
B.3.5 - Using Standard Files&lt;br /&gt;
A system program or application program operates the same on all&lt;br /&gt;
three types of standard files, although the storage_type in the file's&lt;br /&gt;
entry can be used to distinguish between the three. A program rarely&lt;br /&gt;
reads index blocks or allocates blocks on a volume: ProDOS does that.&lt;br /&gt;
The program need only be concerned with the data stored in the file,&lt;br /&gt;
not with how they are stored.&lt;br /&gt;
&lt;br /&gt;
All types of standard files are read as a sequence of bytes, numbered&lt;br /&gt;
from 0 to EOF-1, as explained in Chapter 4.&lt;br /&gt;
&lt;br /&gt;
Page 163&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B.3.6 - Sparse Files&lt;br /&gt;
A sparse file is a sapling or tree file in which the number of data&lt;br /&gt;
bytes that can be read from the file exceeds the number of bytes&lt;br /&gt;
physically stored in the data blocks allocated to the file. ProDOS&lt;br /&gt;
implements sparse files by allocating only those data blocks that have&lt;br /&gt;
had data written to them, as well as the index blocks needed to point&lt;br /&gt;
to them.&lt;br /&gt;
&lt;br /&gt;
For example, you can define a file whose EOF is 16K, that uses only&lt;br /&gt;
three blocks on the volume, and that has only four bytes of data&lt;br /&gt;
written to it. If you create a file with an EOF of $0, ProDOS allocates&lt;br /&gt;
only the key block (a data block) for a seedling file, and fills it with&lt;br /&gt;
null characters (ASCII $00).&lt;br /&gt;
&lt;br /&gt;
If you then set the EOF and MARK to position $0565, and write four&lt;br /&gt;
bytes, ProDOS calculates that position $0565 is byte $0165&lt;br /&gt;
($0564-($0200*2)) of the third block (block $2) of the file. It then&lt;br /&gt;
allocates an index block, stores the address of the current data block&lt;br /&gt;
in position 0 of the index block, allocates another data block, stores the&lt;br /&gt;
address of that data block in position 2 of the index block, and stores&lt;br /&gt;
the data in bytes $0165 through $0168 of that data block. The EOF&lt;br /&gt;
is $0569.&lt;br /&gt;
&lt;br /&gt;
If you now set the EOF to $4000 and close the file, you have a&lt;br /&gt;
16K file that takes up three blocks of space on the volume: two data&lt;br /&gt;
blocks and an index block. You can read 16384 bytes of data from the&lt;br /&gt;
file, but all the bytes before $0565 and after $0568 are nulls.&lt;br /&gt;
Figure B-9 shows how the file is organized.&lt;br /&gt;
&lt;br /&gt;
Page 164&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure B-9. A Sparse File&lt;br /&gt;
&lt;br /&gt;
                  0 1 2&lt;br /&gt;
 key_pointer --&amp;gt; +--------------+&lt;br /&gt;
       Key_Block | | | |        |&lt;br /&gt;
                 +--------------+&lt;br /&gt;
                  |   |&lt;br /&gt;
        +---------+   +-------+                           EOF = $4000&lt;br /&gt;
        |                     |                                     |&lt;br /&gt;
        v Block $0   Block $1 v Block $2   Block $3       Block $1F v&lt;br /&gt;
   Data +-------------------------------------------+   +-----------+&lt;br /&gt;
 Blocks |          |          |     | |  |          |   |           |&lt;br /&gt;
        +-------------------------------------------+   +-----------+&lt;br /&gt;
       $0         $1FF       $400    ^  $5FF&lt;br /&gt;
                                     |&lt;br /&gt;
                      Bytes $565..$568&lt;br /&gt;
&lt;br /&gt;
Thus ProDOS allocates volume space only for those blocks in a file&lt;br /&gt;
that actually contain data. For tree files, the situation is similar: if&lt;br /&gt;
none of the 256 data blocks assigned to an index block in a tree file&lt;br /&gt;
have been allocated, the index block itself is not allocated.&lt;br /&gt;
&lt;br /&gt;
On the other hand, if you CREATE a file with an EOF of $4000&lt;br /&gt;
(making it 16K bytes, or 32 blocks, long), ProDOS allocates an index&lt;br /&gt;
block and 32 data blocks for a sapling file, and fills the data blocks&lt;br /&gt;
with nulls.&lt;br /&gt;
&lt;br /&gt;
By the Way: The first data block of a standard file, be it a seedling,&lt;br /&gt;
sapling, or tree file, is always allocated. Thus there is always a data&lt;br /&gt;
block to be read in when the file is opened.&lt;br /&gt;
&lt;br /&gt;
Page 165&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B.3.7 - Locating a Byte in a File&lt;br /&gt;
The algorithm for finding a specific byte within a standard file is given&lt;br /&gt;
below.&lt;br /&gt;
&lt;br /&gt;
The MARK is a three-byte value that indicates an absolute byte&lt;br /&gt;
position within a file.&lt;br /&gt;
&lt;br /&gt;
 Byte #        Byte 2             Byte 1            Byte 0&lt;br /&gt;
&lt;br /&gt;
 bit #      7             0   7             0   7             0&lt;br /&gt;
           +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+&lt;br /&gt;
 MARK      |Index Number |Data Block Number|   Byte of Block   |&lt;br /&gt;
           +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+&lt;br /&gt;
 Used by:    Tree only    Tree and sapling      All three&lt;br /&gt;
&lt;br /&gt;
If the file is a tree file, then the high seven bits of the MARK&lt;br /&gt;
determine the number (0 to 127) of the index block that points to the&lt;br /&gt;
byte. The value of the seven bits indicate the location of the low byte&lt;br /&gt;
of the index block address within the master index block. The location&lt;br /&gt;
of the high byte of the index block address is indicated by the value of&lt;br /&gt;
these seven bits plus 256.&lt;br /&gt;
&lt;br /&gt;
Page 166&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the file is a tree file or a sapling file, then the next eight bits of the&lt;br /&gt;
MARK determine the number (0-255) of the data block pointed to by&lt;br /&gt;
the indicated index block. This 8-bit value indicates the location of the&lt;br /&gt;
low byte of the data block address within the index block. The high&lt;br /&gt;
byte of the index block address is found at this offset plus 256.&lt;br /&gt;
&lt;br /&gt;
For tree, sapling, and seedling files, the low nine bits of the MARK are&lt;br /&gt;
the absolute position of the byte within the selected data block.&lt;br /&gt;
&lt;br /&gt;
B.4 - Disk Organization&lt;br /&gt;
Figure B-10 presents an overall view of block organization on a volume.&lt;br /&gt;
Figure B-11 shows the complete structures of the three standard files&lt;br /&gt;
types. Figure B-12 is a summary of header and entry field information.&lt;br /&gt;
&lt;br /&gt;
Page 167&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure B-10. Disk Organization&lt;br /&gt;
&lt;br /&gt;
                                     +--------------------+&lt;br /&gt;
                                     | BLOCKS ON A VOLUME |&lt;br /&gt;
                                     |     Figure B-1     |&lt;br /&gt;
                                     +--------------------+&lt;br /&gt;
                                         ||          ||&lt;br /&gt;
                                         ||          ||&lt;br /&gt;
                                         ||          ||&lt;br /&gt;
                                         vv          vv&lt;br /&gt;
                              +----------------------------------+&lt;br /&gt;
                              |   BLOCKS OF A DIRECTORY FILE     |&lt;br /&gt;
            |=================| VOLUME DIRECTORY OR SUBDIRECTORY |&lt;br /&gt;
            ||                |          Figure B-2              |&lt;br /&gt;
            ||                +----------------------------------+&lt;br /&gt;
            ||                          ||                   ||&lt;br /&gt;
            |============================|                   ||&lt;br /&gt;
            ||                          ||                   ||&lt;br /&gt;
            vv                          vv                   vv&lt;br /&gt;
 +----------------------+    +----------------------+    +------------------------------------+&lt;br /&gt;
 |        HEADER        |    |        HEADER        |    |             FILE ENTRY             |&lt;br /&gt;
 |   VOLUME DIRECTORY   |    |     SUBDIRECTORY     |    |           SUBDIRECTORY OR          |&lt;br /&gt;
 |  Found in key block  |    |  Found in key block  |    |            STANDARD FILE           |===&amp;gt;&amp;gt;to Figure B-11&lt;br /&gt;
 | of volume directory. |    |   of subdirectory.   |    | Found in any directory file block. |&lt;br /&gt;
 |      Figure B-3      |    |      Figure B-4      |    |             Figure B-5             |&lt;br /&gt;
 +----------------------+    +----------------------+    +------------------------------------+&lt;br /&gt;
&lt;br /&gt;
Page 168&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B.4.1 - Standard Files&lt;br /&gt;
Figure B-11. Standard Files&lt;br /&gt;
&lt;br /&gt;
            +---------------+&lt;br /&gt;
      |===&amp;gt;&amp;gt;|   KEY BLOCK   |&lt;br /&gt;
      ||    | Standard File |&lt;br /&gt;
      ||    +---------------+&lt;br /&gt;
      ||&lt;br /&gt;
      ||    +----------------------------------+&lt;br /&gt;
      |===&amp;gt;&amp;gt;| SEEDLING FILE: storage_type = $1 |&lt;br /&gt;
      ||    |            Figure B-6            |&lt;br /&gt;
      ||    +----------------------------------+&lt;br /&gt;
      ||&lt;br /&gt;
      ||    +----------------------------------+&lt;br /&gt;
      |===&amp;gt;&amp;gt;| SAPLING FILE: storage_type = $2  |&lt;br /&gt;
      ||    |            Figure B-7            |&lt;br /&gt;
      ||    +----------------------------------+&lt;br /&gt;
      ||&lt;br /&gt;
      ||    +----------------------------------+&lt;br /&gt;
      |===&amp;gt;&amp;gt;| TREE FILE: storage_type = $3     |&lt;br /&gt;
      ||    |            Figure B-8            |&lt;br /&gt;
      ||    +----------------------------------+&lt;br /&gt;
      ||&lt;br /&gt;
 ======|&lt;br /&gt;
 from Figure B-10&lt;br /&gt;
&lt;br /&gt;
Page 169&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B.4.2 - Header and Entry Fields&lt;br /&gt;
Figure B-12. Header and Entry Fields&lt;br /&gt;
&lt;br /&gt;
 +-------------+&lt;br /&gt;
 | CREATE_DATE |                    Byte 1                          Byte 0&lt;br /&gt;
 |             |&lt;br /&gt;
 | MOD_DATE    |         7   6   5   4   3   2   1   0 | 7   6   5   4   3   2   1   0&lt;br /&gt;
 +-------------+ ----&amp;gt; +---------------------------------------------------------------+&lt;br /&gt;
                       |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |&lt;br /&gt;
                       |           Year            |     Month     |        Day        |&lt;br /&gt;
                       |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |&lt;br /&gt;
                       +---------------------------------------------------------------+&lt;br /&gt;
 +-------------+&lt;br /&gt;
 | CREATE_TIME |&lt;br /&gt;
 |             |&lt;br /&gt;
 | MOD_TIME    |&lt;br /&gt;
 +-------------+ ----&amp;gt; +---------------------------------------------------------------+&lt;br /&gt;
                       |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |&lt;br /&gt;
                       | 0   0   0 |       Hour        | 0   0 |        Minute         |&lt;br /&gt;
                       |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |&lt;br /&gt;
                       +---------------------------------------------------------------+&lt;br /&gt;
                                    Byte 1                          Byte 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                                                                                 +-------- Write-Enable&lt;br /&gt;
                                                                                 |   +---- Read-Enable&lt;br /&gt;
                                                                                 |   |&lt;br /&gt;
 +--------------+                       +----------+   +-------------------------------+&lt;br /&gt;
 | storage_type |                       |  access  | = | D | RN | B | Reserved | W | R |&lt;br /&gt;
 |   (4 bits)   |                       | (1 byte) |   +-------------------------------+&lt;br /&gt;
 +--------------+                       +----------+     |   |    |&lt;br /&gt;
                                                         |   |    +----------------------- Backup&lt;br /&gt;
 $0 = inactive file entry                                |   +---------------------------- Rename-Enable&lt;br /&gt;
 $1 = seedling file entry                                +-------------------------------- Destroy-Enable&lt;br /&gt;
 $2 = sapling file entry&lt;br /&gt;
 $3 = tree file entry&lt;br /&gt;
 $D = subdirectory file entry                          name_length = length of file_name ($1-$F)&lt;br /&gt;
 $E = subdirectory header                              file_name = $1-$F ASCII characters: first = letters&lt;br /&gt;
 $F = volume directory header                                      rest are letters, digits, periods.&lt;br /&gt;
                                                       key_pointer = block address of file's key block&lt;br /&gt;
 +-----------+                                         blocks_used = total blocks for file&lt;br /&gt;
 | file_type |                                         EOF = byte number for end of file ($0-$FFFFFF)&lt;br /&gt;
 | (1 byte)  |                                         version, min_version = 0 for ProDOS 1.0&lt;br /&gt;
 +-----------+                                         entry_length = $27 for ProDOS 1.0&lt;br /&gt;
                                                       entries_per_block = $0D for ProDOS 1.0&lt;br /&gt;
 See section B.4.2.4                                   aux_type = defined by system program&lt;br /&gt;
                                                       file_count = total files in directory&lt;br /&gt;
                                                       bit_map_pointer = block address of bit map&lt;br /&gt;
                                                       total_blocks = total blocks on volume&lt;br /&gt;
                                                       parent_pointer = block address containing entry&lt;br /&gt;
                                                       parent_entry_number = number in that block&lt;br /&gt;
                                                       parent_entry_length = $27 for ProDOS 1.0&lt;br /&gt;
                                                       header pointer = block address of key block&lt;br /&gt;
                                                                        of entry's directory&lt;br /&gt;
&lt;br /&gt;
Page 170&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B.4.2.1 - The storage_type Attribute&lt;br /&gt;
The storage_type, the high-order four bits of the first byte of an entry,&lt;br /&gt;
defines the type of header (if the entry is a header) or the type of file&lt;br /&gt;
described by the entry.&lt;br /&gt;
&lt;br /&gt;
$0 indicates an inactive file entry&lt;br /&gt;
$1 indicates a seedling file entry (EOF &amp;lt;= 256 bytes)&lt;br /&gt;
$2 indicates a sapling file entry (256 &amp;lt; EOF &amp;lt;= 128K bytes)&lt;br /&gt;
$3 indicates a tree file entry (128K &amp;lt; EOF &amp;lt; 16M bytes)&lt;br /&gt;
$4 indicates Pascal area&lt;br /&gt;
$D indicates a subdirectory file entry&lt;br /&gt;
$E indicates a subdirectory header&lt;br /&gt;
$F indicates a volume directory header&lt;br /&gt;
&lt;br /&gt;
The name_length, the low-order four bits of the first byte, specifies&lt;br /&gt;
the number of characters in the file_name field.&lt;br /&gt;
&lt;br /&gt;
ProDOS automatically changes a seedling file to a sapling file and a&lt;br /&gt;
sapling file to a tree file when the file's EOF grows into the range for&lt;br /&gt;
a larger type. If a file's EOF shrinks into the range for a smaller type,&lt;br /&gt;
ProDOS changes a tree file to a sapling file and a sapling file to a&lt;br /&gt;
seedling file.&lt;br /&gt;
&lt;br /&gt;
B.4.2.2 - The creation and last_mod Fields&lt;br /&gt;
The date and time of the creation and last modification of each file&lt;br /&gt;
and directory is stored as two four-byte values, as shown in&lt;br /&gt;
Figure B-13.&lt;br /&gt;
&lt;br /&gt;
Figure B-13. Date and Time Format&lt;br /&gt;
&lt;br /&gt;
              Byte 1                          Byte 0&lt;br /&gt;
&lt;br /&gt;
   7   6   5   4   3   2   1   0 | 7   6   5   4   3   2   1   0&lt;br /&gt;
 +---------------------------------------------------------------+&lt;br /&gt;
 |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |&lt;br /&gt;
 |           Year            |     Month     |        Day        |&lt;br /&gt;
 |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |&lt;br /&gt;
 +---------------------------------------------------------------+&lt;br /&gt;
&lt;br /&gt;
 +---------------------------------------------------------------+&lt;br /&gt;
 |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |&lt;br /&gt;
 | 0   0   0 |       Hour        | 0   0 |        Minute         |&lt;br /&gt;
 |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |&lt;br /&gt;
 +---------------------------------------------------------------+&lt;br /&gt;
              Byte 1                          Byte 0&lt;br /&gt;
&lt;br /&gt;
The values for the year, month, day, hour, and minute are stored as&lt;br /&gt;
binary integers, and may be unpacked for analysis.&lt;br /&gt;
&lt;br /&gt;
Page 171&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B.4.2.3 - The access Attribute&lt;br /&gt;
The access attribute field (Figure B-14) determines whether the file&lt;br /&gt;
can be read from, written to, deleted, or renamed. It also contains a bit&lt;br /&gt;
that can be used to indicate whether a backup copy of the file has&lt;br /&gt;
been made since the file's last modification.&lt;br /&gt;
&lt;br /&gt;
Figure B-14. The access Attribute Field&lt;br /&gt;
&lt;br /&gt;
                           +-------- Write-Enable&lt;br /&gt;
                           |   +---- Read-Enable&lt;br /&gt;
                           |   |&lt;br /&gt;
 +-------------------------------+&lt;br /&gt;
 | D | RN | B | Reserved | W | R |&lt;br /&gt;
 +-------------------------------+&lt;br /&gt;
   |   |    |&lt;br /&gt;
   |   |    +----------------------- Backup&lt;br /&gt;
   |   +---------------------------- Rename-Enable&lt;br /&gt;
   +-------------------------------- Destroy-Enable&lt;br /&gt;
&lt;br /&gt;
A bit set to 1 indicates that the operation is enabled; a bit cleared to 0&lt;br /&gt;
indicates that the operation is disabled. The reserved bits are always 0.&lt;br /&gt;
&lt;br /&gt;
ProDOS sets bit 5, the backup bit, of the access field to 1 whenever&lt;br /&gt;
the file is changed (that is, after a CREATE, RENAME, CLOSE after&lt;br /&gt;
WRITE, or SET_FILE_INFO operation). This bit should be reset to 0&lt;br /&gt;
whenever the file is duplicated by a backup program.&lt;br /&gt;
&lt;br /&gt;
Note: Only ProDOS may change bits 2-4; only backup programs should&lt;br /&gt;
clear bit 5, using SET_FILE_INFO.&lt;br /&gt;
&lt;br /&gt;
B.4.2.4 - The file_type Attribute&lt;br /&gt;
The file_type attribute within an entry field identifies the type of file&lt;br /&gt;
described by that entry. This field should be used by system programs&lt;br /&gt;
to guarantee file compatibility from one system program to the next.&lt;br /&gt;
The values of this byte are shown in Table B-1.&lt;br /&gt;
&lt;br /&gt;
Page 172&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Table B-1. The ProDOS File_Types&lt;br /&gt;
&lt;br /&gt;
The file types marked with a * apply to Apple III only; they are not&lt;br /&gt;
ProDOS compatible. For the file types used by Apple III SOS only, refer&lt;br /&gt;
to the SOS Reference Manual.&lt;br /&gt;
&lt;br /&gt;
 File Type      Preferred Use&lt;br /&gt;
 $00            Typeless file (SOS and ProDOS)&lt;br /&gt;
 $01            Bad block file&lt;br /&gt;
 $02 *          Pascal code file&lt;br /&gt;
 $03 *          Pascal text file&lt;br /&gt;
 $04            ASCII text file (SOS and ProDOS)&lt;br /&gt;
 $05 *          Pascal data file&lt;br /&gt;
 $06            General binary file (SOS and ProDOS)&lt;br /&gt;
 $07 *          Font file&lt;br /&gt;
 $08            Graphics screen file&lt;br /&gt;
 $09 *          Business BASIC program file&lt;br /&gt;
 $0A *          Business BASIC data file&lt;br /&gt;
 $0B *          Word Processor file&lt;br /&gt;
 $0C *          SOS system file&lt;br /&gt;
 $0D,$0E *      SOS reserved&lt;br /&gt;
 $0F            Directory file (SOS and ProDOS)&lt;br /&gt;
 $10 *          RPS data file&lt;br /&gt;
 $11 *          RPS index file&lt;br /&gt;
 $12 *          AppleFile discard file&lt;br /&gt;
 $13 *          AppleFile model file&lt;br /&gt;
 $14 *          AppleFile report format file&lt;br /&gt;
 $15 *          Screen Library file&lt;br /&gt;
 $16-$18 *      SOS reserved&lt;br /&gt;
 $19            AppleWorks Data Base file&lt;br /&gt;
 $1A            AppleWorks Word Processor file&lt;br /&gt;
 $1B            AppleWorks Spreadsheet file&lt;br /&gt;
 $1C-$EE        Reserved&lt;br /&gt;
 $EF            Pascal area&lt;br /&gt;
 $F0            ProDOS CI added command file&lt;br /&gt;
 $F1-$F8        ProDOS user defined files 1-8&lt;br /&gt;
 $F9            ProDOS reserved&lt;br /&gt;
 $FA            Integer BASIC program file&lt;br /&gt;
 $FB            Integer BASIC variable file&lt;br /&gt;
 $FC            Applesoft program file&lt;br /&gt;
 $FD            Applesoft variables file&lt;br /&gt;
 $FE            Relocatable code file (EDASM)&lt;br /&gt;
 $FF            ProDOS system file&lt;br /&gt;
&lt;br /&gt;
Page 173&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B.5 - DOS 3.3 Disk Organization&lt;br /&gt;
Both DOS 3.3 and ProDOS 140K flexible disks are formatted using the&lt;br /&gt;
same 16-sector layout. As a consequence, the ProDOS READ_BLOCK&lt;br /&gt;
and WRITE_BLOCK calls are able to access DOS 3.3 disks too. These&lt;br /&gt;
calls know nothing about the organization of files on either type of&lt;br /&gt;
disk.&lt;br /&gt;
&lt;br /&gt;
When using READ_BLOCK and WRITE_BLOCK, you specify a&lt;br /&gt;
512-byte block on the disk. When using RWTS (the DOS 3.3&lt;br /&gt;
counterpart to READ_BLOCK and WRITE_BLOCK), you specify the&lt;br /&gt;
track and sector of a 256-byte chunk of data, as explained in the DOS&lt;br /&gt;
Programmer's Manual. You use READ_BLOCK and WRITE_BLOCK&lt;br /&gt;
to access DOS 3.3 disks, you must know what 512-byte block&lt;br /&gt;
corresponds to the track and sector you want.&lt;br /&gt;
&lt;br /&gt;
Figure B-15 shows how to determine a block number from a given&lt;br /&gt;
track and sector. First multiply the track number by 8, then add the&lt;br /&gt;
Sector Offset that corresponds to the sector number. The half of the&lt;br /&gt;
block in which the sector resides is determined by the Half-of-Block&lt;br /&gt;
line (1 is the first half; 2 is the second).&lt;br /&gt;
&lt;br /&gt;
Figure B-15. Tracks and Sectors to Blocks&lt;br /&gt;
&lt;br /&gt;
       Block = (8 * Track) + Sector Offset&lt;br /&gt;
&lt;br /&gt;
        Sector : 0 1 2 3 4 5 6 7 8 9 A B C D E F&lt;br /&gt;
 Sector Offset : 0 7 6 6 5 5 4 4 3 3 2 2 1 1 0 7&lt;br /&gt;
  Half of Block: 1 1 2 1 2 1 2 1 2 1 2 1 2 1 2 2&lt;br /&gt;
&lt;br /&gt;
Refer to the DOS Programmer's Manual for a description of the file&lt;br /&gt;
organization of DOS 3.3 disks.&lt;/div&gt;</summary>
		<author><name>Bjc2406</name></author>	</entry>

	</feed>