Table des matières

FCB - DOS File Control Block

Standard DOS File Control Block

Offset Size Description
00 byte drive number (0 for default drive, 1=A:, 2=B:, …)
01 8 bytes filename, left justified with trailing blanks
09 3 bytes filename extension, left justified w/blanks
0C word current block number relative to beginning of the file, starting with zero
0E word logical record size in bytes
10 dword file size in bytes
14 word date the file was created or last updated
16 word time of last write
18 8 bytes see below for version specific information
1A dword address of device header if character device
20 byte current relative record number within current BLOCK
21 dword relative record number relative to the beginning of the file, starting with zero; high bit omitted if record length is 64 bytes

Extended DOS File Control Block

Offset Size Description
00 byte if FF this is an extended FCB
01 5 bytes reserved
06 byte file attribute if extended FCB
07 byte drive number (0 for default drive, 1=A:, 2=B:, …)
08 8 bytes filename, left justified with trailing blanks
10 3 bytes filename extension, left justified w/blanks
13 word current block number relative to beginning of the file, starting with zero
15 word logical record size in bytes
17 dword file size in bytes
1B word date the file was created or last updated
1D word time of last write
1F 8 bytes see below for version specific information
27 byte current relative record number within current BLOCK
28 dword relative record number relative to the beginning of the file, starting with zero; high bit omitted if record length is 64 bytes

information in GREEN are undocumented.

word offset 14:

|F|E|D|C|B|A|9|8|7|6|5|4|3|2|1|0| 15,14 (Intel reverse order)
 | | | | | | | | | | | `--------- day 1-31
 | | | | | | | `---------------- month 1-12
 `----------------------------- year + 1980

word offset 16:

|F|E|D|C|B|A|9|8|7|6|5|4|3|2|1|0| 17,16 (Intel reverse order)
 | | | | | | | | | | | `---------- secs in 2 second increments
 | | | | | `--------------------- minutes (0-59)
 `------------------------------ hours (0-23)

DOS Version Specific parameters

DOS 2.x Values for reserved fields at offsets 18h-1Ah

Offset Size Description
18 Byte see below
19 Word starting cluster number
|7|6|5|4|3|2|1|0|
 | | `------------- unknown
 | `-------------- 1 = open
 `--------------- 1 = logical device

DOS 3.x Values for reserved fields at offsets 18h-19h

Offset Size Description
18 Byte System File Table (SFT) entry for file
19 Byte attributes
|7|6|5|4|3|2|1|0|  attributes
 | | `-------------- unknown
 `--- share status  

Share Status

00 SHARE not loaded block device
01 SHARE not loaded characted device
10 SHARE loaded, remote file
11 SHARE loaded local file

DOS 3.x with SHARE, local file reserved offsets 1Ah-1Eh

Offset Size Description
1A word starting cluster number
1C word offset within SHARE of sharing record
1E byte file attribute

DOS 3.x with SHARE, remote file reserved offsets 1Ah-1Eh

Offset Size Description
1A word sector number containing directory entry
1C word last cluster accessed relative to beginning of file
1E byte absolute cluster number of last cluster accessed

DOS 3.x without SHARE reserved offsets 1Ah-1Fh Ø

Offset Size Description
1A byte ((device attribute word low byte) AND 0Ch) OR (open mode)
1B word starting cluster number
1D word sector number containing directory entry
1F byte number of directory entry within sector
INT 21,0F Open file using FCB
INT 21,10 Close file using FCB
INT 21,11 Search for first entry using FCB
INT 21,12 Search for next entry using FCB
INT 21,13 Delete file using FCB
INT 21,14 Sequential read using FCB
INT 21,15 Sequential write using FCB
INT 21,16 Create a file using FCB
INT 21,17 Rename file using FCB
INT 21,21 Random read using FCB
INT 21,22 Random write using FCB
INT 21,23 Get file size using FCB
INT 21,24 Set relative record field for FCB
INT 21,27 Random block read using FCB
INT 21,28 Random block write using FCB
INT 21,29 Parse filename for FCB