Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
File Control Block
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Multiple issues| {{refimprove|date=January 2014}} {{Technical|date=October 2022}} }} {{Use dmy dates|date=May 2019|cs1-dates=y}} A '''File Control Block''' ('''FCB''') is a file system structure in which the state of an open [[Computer file|file]] is maintained. A FCB is managed by the operating system, but it resides in the memory of the program that uses the file, not in operating system memory. This allows a process to have as many files open at one time as it wants, 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 backward 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, led 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 DOS, and also depending on what operation is being performed. The following fields have consistent meanings:<ref name="stanislavs"/> {|class="wikitable" |- ! Offset !! Byte<br/>size !! Contents |- | 0x00 |align=right| 1 || Drive number β 0 for default, 1 for A:, 2 for B:, ... |- | 0x01 |align=right| 8 |rowspan=2| File name and [[Filename extension|extension]] β together these form a [[8.3 filename|8.3 file name]]. |- | 0x09 |align=right| 3 |- | 0x0C |align=right| 20 || Implementation dependent β should be initialised to zero before the FCB is opened. |- | 0x20 |align=right| 1 || Record number in the current section of the file β used when performing [[sequential access]]. |- | 0x21 |align=right| 3 || Record number to use when performing [[random access]]. |} The 20-byte-long field starting at offset 0x0C contained fields which (among others) provided further information about the file:<ref name="Programacion_Ensamblador_MSDOS"/> {|class="wikitable" |- ! Offset !! Byte<br/>size !! Contents |- | 0x0E |align=right| 2 || File's record length in bytes. |- | 0x10 |align=right| 4 || Total file size in bytes. |- | 0x14 |align=right| 2 || Date of last modification to file contents. |- | 0x16 |align=right| 2 || Time of last modification. |} Further values were used by newer versions of DOS until new information could no longer fit in these 20 bytes. Some preceding "negative offset" bytes were squeezed from reserved spaces in CP/M Zero Page and DOS [[Program Segment Prefix]] for storing file attributes.<ref name="stanislavs"/>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)