29.12.2012 Views

The Programmer's Guide to TRSDOS Version 6 - Tim Mann's Home ...

The Programmer's Guide to TRSDOS Version 6 - Tim Mann's Home ...

The Programmer's Guide to TRSDOS Version 6 - Tim Mann's Home ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

5.4.5 LOGICAL RECORD LENGTH - <br />

This field contains the Logical Record Length (LRL) specified when the file was initially<br />

generated (via @INIT) or subsequently changed by being overwritten with some file that<br />

has another LRL via "COPY (CLONE)" or "BACKUP". A value of "0" indicates that the LRL is<br />

equal <strong>to</strong> 256.<br />

5.4.6 FILE NAME - <br />

This field contains the name portion of the file specification. <strong>The</strong> file name will be<br />

left justified and padded with trailing blanks. <strong>The</strong> name will always be in upper case<br />

characters . If a file has FXDE records in addition <strong>to</strong> the FPDE, only the FPDE<br />

will contain the filename in this field.<br />

5.4.7 FILE EXTENSION - <br />

This field contains the extension portion of the file specification. As in the name<br />

field, it is left justified and padded with trailing blanks. If a file has FXDE records<br />

in addition <strong>to</strong> the FPDE, only the FPDE will contain the file extension in this field.<br />

5.4.8 OWNER PASSWORD - <br />

This field contains the hash code of the OWNER password. <strong>The</strong> OWNER password is used <strong>to</strong><br />

gain full access <strong>to</strong> a password protected file. Passwords are assigned at file creation<br />

and/or changed with the ATTRIB library command. <strong>The</strong> 16-bit hash code for a file password<br />

can be obtained using the method shown for obtaining the disk master password hash code.<br />

5.4.9 USER PASSWORD - <br />

This field contains the hash code of the USER password. THE USER password is required <strong>to</strong><br />

access the file at the level of protection identified in the attribute field. Passwords<br />

are assigned at file creation and/or changed with the ATTRIB library command. <strong>The</strong> 16-bit<br />

hash code for a file password can be obtained using the method shown for obtaining the<br />

disk master password hash code.<br />

5.4.10 ENDING RECORD NUMBER - <br />

This field contains the ending record number (ERN) which is based on full sec<strong>to</strong>rs. If the<br />

ERN is zero, it indicates a file where no writing has taken place (or a lot of writing<br />

whereby you forgot <strong>to</strong> close the file). If the LRL is not 256, the ERN value represents<br />

the sec<strong>to</strong>r where the EOF occurs. Each time a sec<strong>to</strong>r is written <strong>to</strong> the disk, the ERN is<br />

advanced by one - even if the sec<strong>to</strong>r is not a full sec<strong>to</strong>r. Thus, if ERN shows 3, and EOF<br />

OFFSET shows 0, then three full sec<strong>to</strong>rs have been written (relative 0, 1, and 2). If ERN<br />

shows 3 and EOF OFFSET shows 62, then two full sec<strong>to</strong>rs and one partial sec<strong>to</strong>r of 62 bytes<br />

have been written.<br />

5.4.11 EXTENT DATA FIELDS - <br />

<strong>The</strong> extent data fields contain data on the allocation of disk space for the file. Each<br />

field is composed of 16-bits and can contain the allocation information for a maximum of<br />

32 contiguous granules. <strong>The</strong>ir contents tell you what cylinder s<strong>to</strong>res the first granule of<br />

the extent, what is the relative number of that granule, and how many contiguous granules<br />

are in use in the extent. Each extent is encoded according <strong>to</strong> the pattern illustrated for<br />

extent field 1.<br />

5.4.11.1 Extent Field 1 - <br />

Bits 15-8 Contain the cylinder number for the starting granule of that extent. <strong>The</strong><br />

extent uses space on the disk starting from this cylinder and the sec<strong>to</strong>r<br />

based on the starting granule, for as many granules as are noted in bits 4-<br />

0.<br />

Bits 7-5 Contain the relative granule number (0-7) in the cylinder which is the first<br />

granule of the file for that extent. This value is numbered starting from<br />

zero. (i.e. a "0" indicates that the first granule in use is the first<br />

granule on the cylinder. This would be sec<strong>to</strong>r 0. A "1" would indicate that<br />

5-12

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!