2.2 Disc Directory
Every disc has two sections, the directory and the data area. The directory contains a list of all the filenames and a 'map' of whereabouts on the disc each file is to be found. AMSDOS or CP/M can calculate the size of a particular file by inspecting its directory entry. Calculation of the amount of space left on a disc is made by adding up all the files in the directory and seeing how much remains unused.
Whenever a file is read its directory entry is examined, giving the disc location. When a new file is created free space is allocated to it and when a file is erased the space is relinquished. The directory works in units of 1K and can have up to 64 different entries. Large files will have one entry for every 16K although normally this fact is hidden from the user.
2.3 AMSDOS filenames and filetypes.
When using the CPC464 datacorder, filenames are permitted up to 16 characters and do not normally contain any information about the type of file (eg BASIC, Binary etc. ) This information is contained in a small record at the beginning of the file, called the header, and can be displayed by using the CAT command. When using disc systems it is standard practice to name disc files in such a way that there is an indication of which type they are. This naming convention DOES NOT 'force' the computer to use the file in any particular way, but some programs will only accept a file when it has the correct type of name. BASIC will accept any type of name, but will search in preference for certain file types if not otherwise specified. (See section 2.3.2)
2.3.1 Construction of Filenames
The filename is constructed from two parts with a . separating them. The first part can be up to 8 characters long, and the second up to 3 characters long. Thus, for example, "SCREEN.BIN", "WELCOMED. BAS" and "FORMAT.COM” are all legal filenames. The second part of the filename is called the filetype. Filenames and filetypes and can be composed of a mixture of letters and numbers, but cannot have embedded spaces. Some common conventional filetypes are:
.<space> | Unspecified type. May be a data file created by an OPENOUT |
| "RESULTS" or BASIC program saved by AMSDOS using SAVE " |
| PROGRAM",A style. |
.BAS | BASIC program saved by AMSDOS using SAVE "PROGRAM" or |
| SAVE "PROGRAM",P or SAVE "PROGRAM.BAS",A styles. |
.BIN | Program or area of memory saved by AMSDOS using SAVE |
| "MEMORY",B,<binary parameters>, style. |
.BAK | Old version of a file, where AMSDOS or a utility program has saved |
| a newer version of a file using an existing name. This allows the user |
| to |
.COM | Command file. CP/M utility programs are all of this filetype. |
AMSTRAD Disc Drive & Interface | Chapter 2. 2 |