File control block
Encyclopedia
A File Control Block is a file system structure in which the state of an open file
is maintained.
The FCB originates from CP/M
and is also present in most variants of DOS
. A full FCB is 36 bytes long; in early versions of CP/M, it was 33 bytes.
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:
), the FCB was the only method of accessing files. When directories were introduced in MS-DOS 2, FCBs were superseded by file handles.
FCBs were supported in all versions of MS-DOS and Windows
until the introduction of the FAT32 filesystem. Windows 95
, Windows 98
and Windows Me
do not support the use of FCBs on FAT32 drives, except to read the volume label. This caused some old DOS applications, including Wordstar
, to fail under these versions of Windows.
The FCB interface does not work properly on Windows NT
, 2000
, etc. either - WordStar does not function properly on these operating systems. The emulator DOSEMU
implements the FCB interface properly, and is one way to run older programs.
Computer file
A computer file is a block of arbitrary information, or resource for storing information, which is available to a computer program and is usually based on some kind of durable storage. A file is durable in the sense that it remains available for programs to use after the current program has finished...
is maintained.
The FCB originates from CP/M
CP/M
CP/M was a mass-market operating system created for Intel 8080/85 based microcomputers by Gary Kildall of Digital Research, Inc...
and is also present in most variants of DOS
DOS
DOS, short for "Disk Operating System", is an acronym for several closely related operating systems that dominated the IBM PC compatible market between 1981 and 1995, or until about 2000 if one includes the partially DOS-based Microsoft Windows versions 95, 98, and Millennium Edition.Related...
. A full FCB is 36 bytes long; in early versions of CP/M, it was 33 bytes.
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 Sequential access In computer science, sequential access means that a group of elements is accessed in a predetermined, ordered sequence. Sequential access is sometimes the only way of accessing the data, for example if it is on a tape... . |
21 | 3 | Record number to use when performing random access Random access In computer science, random access is the ability to access an element at an arbitrary position in a sequence in equal time, independent of sequence size. The position is arbitrary in the sense that it is unpredictable, thus the use of the term "random" in "random access"... . |
Usage
In CP/M and MS-DOS 1 (which did not include support for directoriesDirectory (file systems)
In computing, a folder, directory, catalog, or drawer, is a virtual container originally derived from an earlier Object-oriented programming concept by the same name within a digital file system, in which groups of computer files and other folders can be kept and organized.A typical file system may...
), the FCB was the only method of accessing files. When directories were introduced in MS-DOS 2, FCBs were superseded by file handles.
FCBs were supported in all versions of MS-DOS and Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...
until the introduction of the FAT32 filesystem. Windows 95
Windows 95
Windows 95 is a consumer-oriented graphical user interface-based operating system. It was released on August 24, 1995 by Microsoft, and was a significant progression from the company's previous Windows products...
, Windows 98
Windows 98
Windows 98 is a graphical operating system by Microsoft. It is the second major release in the Windows 9x line of operating systems. It was released to manufacturing on 15 May 1998 and to retail on 25 June 1998. Windows 98 is the successor to Windows 95. Like its predecessor, it is a hybrid...
and Windows Me
Windows Me
Windows Millennium Edition, or Windows Me , is a graphical operating system released on September 14, 2000 by Microsoft, and was the last operating system released in the Windows 9x series. Support for Windows Me ended on July 11, 2006....
do not support the use of FCBs on FAT32 drives, except to read the volume label. This caused some old DOS applications, including Wordstar
WordStar
WordStar is a word processor application, published by MicroPro International, originally written for the CP/M operating system but later ported to DOS, that enjoyed a dominant market share during the early to mid-1980s. Although Seymour I...
, to fail under these versions of Windows.
The FCB interface does not work properly on Windows NT
Windows NT
Windows NT is a family of operating systems produced by Microsoft, the first version of which was released in July 1993. It was a powerful high-level-language-based, processor-independent, multiprocessing, multiuser operating system with features comparable to Unix. It was intended to complement...
, 2000
Windows 2000
Windows 2000 is a line of operating systems produced by Microsoft for use on personal computers, business desktops, laptops, and servers. Windows 2000 was released to manufacturing on 15 December 1999 and launched to retail on 17 February 2000. It is the successor to Windows NT 4.0, and is the...
, etc. either - WordStar does not function properly on these operating systems. The emulator DOSEMU
DOSEMU
DOSEMU, alternatively rendered dosemu, is a compatibility layer software package that enables MS-DOS systems, DOS clones such as FreeDOS, and DOS software to run under Linux on x86-based PCs ....
implements the FCB interface properly, and is one way to run older programs.