+0 1 bDrvID drive ID (see below)
+1 8 abName left-justified, blank-padded (e.g. 'FILE '
+9 3 abExt left-justified, blank-padded (e.g. 'EXT'
+0cH 2 wCurBlock current block number
+0eH 2 wRecSize logical record size
+10H 4 lFileSize length of file
+14H 2 rDate Date created/last modified in FileTimeRec format
+14H 2 rTime Time created/last modified in FileDateRec format
+16H 8 res (reserved, undocumented)
+20H 2 wCurRecNo current position in current block (0-7fH)
+21H 4 lRndmRecNo current record number in entire file
bDrvID Drive number. Before open: 0=default, 1=A, 2=B, etc.
After open: 0=A, 1=B, etc.)
abName Filename. If fewer than 8 characters, it is padded to 8 with
abExt File extension. If fewer than 3 characters, it is padded to 3
wCurBlock Current block number (a block is 128 records). DOS sets to 0
wRecSize Size of a record, in bytes. DOS sets to 128 on open.
lFileSize Total size of the file, in bytes
wCurRecNo position within the current record (wCurRec)
lRndmRecNo file position, specified as a number of records from the start
Notes: FCBs are obsolete, but still supported by DOS. There is no
need to use this structure at all.
Unopened FCB: Before opening a file, you need only supply
bDrvID, abName, and abExt (e.g.: 0,'MYFILE TXT') and leave
room for DOS to fill in the other fields.
Opened FCB: After successfully opening an FCB, the bDrvID
contains a non-zero drive number (A=1, B=3, etc), other fields
have been set up for access to the start of the file.
I won't bother covering the arcane system of block-and-record
bookkeeping used to position the file pointer. R.I.P.
you must use an Extended FCB...
-7 1 bSig ffH (signature indicates Extended FCB)
+0 1 bDrvID drive ID (see below)
. (other fields as above)
...that is simply an FcbRec, preceded by 7 bytes, with [FCB-7]
being 0ffH and [FCB-1] being the file attribute. Weird, huh?