All Topics  
File control block

 

   Email Print
   Bookmark   Link






 

File control block



 
 
A File Control Block (FCB) is a file system structure in which the state of an open file
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 computer storage....
 is maintained. The FCB originates from CP/M
CP/M

CP/M is an operating system originally created for Intel 8080/Intel 8085 based microcomputers by Gary Kildall of Digital Research. Initially confined to single tasking on 8-bit processors and no more than 64 kilobytes of memory, later versions of CP/M added multi-user variations, and were migrated to 16-bit processors....
 and is also present in all versions of MS-DOS
MS-DOS

MS-DOS is an operating system commercialized by Microsoft. It was the most commonly used member of the DOS family of operating systems and was the main operating system for personal computers during the 1980s....
. 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.






Discussion
Ask a question about 'File control block'
Start a new discussion about 'File control block'
Answer questions from other users
Full Discussion Forum



Encyclopedia


A File Control Block (FCB) is a file system structure in which the state of an open file
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 computer storage....
 is maintained. The FCB originates from CP/M
CP/M

CP/M is an operating system originally created for Intel 8080/Intel 8085 based microcomputers by Gary Kildall of Digital Research. Initially confined to single tasking on 8-bit processors and no more than 64 kilobytes of memory, later versions of CP/M added multi-user variations, and were migrated to 16-bit processors....
 and is also present in all versions of MS-DOS
MS-DOS

MS-DOS is an operating system commercialized by Microsoft. It was the most commonly used member of the DOS family of operating systems and was the main operating system for personal computers during the 1980s....
. 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 Size Contents
00 Byte Drive number — 0 for default, 1 for A:, 2 for B:,...
01 8 bytes File name and file type — together these form a 8.3 file name
09 3 bytes
0C 20 bytes Implementation dependent — should be initialised to zero before the FCB is opened.
20 1 byte 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 bytes Record number to use when performing random access
Random access

In computer science, random access is the ability to access an arbitrary element of a sequence in equal time. The opposite is sequential access, where a remote element takes longer time to access....
.


Usage

In CP/M and MS-DOS 1 (which did not include support for directories
Directory (file systems)

In computing, a directory, folder, catalog, or drawer is a virtual container within a digital file system, in which groups of files and other directories can be kept and organized....
), 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 software operating systems and graphical user interfaces produced by Microsoft. Microsoft first introduced an operating environment named Windows in November 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces ....
 until the introduction of the FAT32
File Allocation Table

File Allocation Table or FAT is a computer file system architecture now widely used on most computer systems and most memory cards, such as those used with digital cameras....
 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 Microsoft Windows products....
, Windows 98
Windows 98

Windows 98 is a graphical operating system released on 25 June 1998 by Microsoft and the successor to Windows 95. Like its predecessor, it is a hybrid 16-bit application/32-bit application monolithic product based on MS-DOS....
 and Windows Me
Windows Me

Windows Millennium Edition, or Windows Me , is a hybrid 16-bit/32-bit graphical operating system released on 14 September 2000 by Microsoft....
 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 was 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....
, 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
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.