File Control Block

A File Control Block (FCB) is a file system structure in which the state of an open file is maintained. An FCB is managed by the operating sytem, but it resides in the memory of the program that uses the file, not in operating system memory. This allows a program to have as many files open at one time as it wants to, provided it can spare enough memory for an FCB per file.

The FCB originates from CP/M and is also present in most variants of DOS, though only as a backwards compatibility measure in MS-DOS versions 2.0 and later. A full FCB is 36 bytes long; in early versions of CP/M, it was 33 bytes. This fixed size, which could not be increased without breaking application compatibility, lead to the FCB's eventual demise as the standard method of accessing files.

The meanings of several of the fields in the FCB differ between CP/M and MS-DOS, and also depending on what operation is being performed. The following fields have consistent meanings:

Offset Byte
size
Contents
00 1 Drive number — 0 for default, 1 for A:, 2 for B:,...
01 8 File name and file type — together these form a 8.3 file name
09 3
0C 20 Implementation dependent — should be initialised to zero before the FCB is opened.
20 1 Record number in the current section of the file — used when performing sequential access.
21 3 Record number to use when performing random access.

Read more about File Control Block:  Usage

Famous quotes containing the words file, control and/or block:

    I have been a soreheaded occupant of a file drawer labeled “Science Fiction” ... and I would like out, particularly since so many serious critics regularly mistake the drawer for a urinal.
    Kurt Vonnegut, Jr. (b. 1922)

    All industries are brought under the control of such people [film producers] by Capitalism. If the capitalists let themselves be seduced from their pursuit of profits to the enchantments of art, they would be bankrupt before they knew where they were. You cannot combine the pursuit of money with the pursuit of art.
    George Bernard Shaw (1856–1950)

    The chess pieces are the block alphabet which shapes thoughts; and these thoughts, although making a visual design on the chess-board, express their beauty abstractly, like a poem.... I have come to the personal conclusion that while all artists are not chess players, all chess players are artists.
    Marcel Duchamp (1887–1968)