At its simplest, the Compound File Binary Format is a container, with little restriction on what can be stored within it.
A CFBF file structure loosely resembles a FAT file system. The file is partitioned into Sectors which are chained together with a File Allocation Table (not to be mistaken with the file system of the same name) which contains chains of sectors related to each file, a Directory holds information for contained files with a Sector ID (SID) for the starting sector of a chain and so on.
The CFBF file consists of a 512-byte header record followed by a number of Sectors whose size is defined in the header. The literature defines Sectors to be either 512 or 4096 bytes in length, although the format is potentially capable of supporting sectors ranging in size from 128 bytes upwards, in powers of two (128, 256, 512, 1024, etc.). The lower limit of 128 is the minimum required to fit a single directory entry in a Directory Sector.[relevant?]
There are several types of sector that may be present in a CFBF file:
More detail is given below for the header and each sector type.
The CFBF header occupies the first 512 bytes of the file and information required to interpret the rest of the file. The C-style structure declaration below (extracted from the AAFA's Low-Level Container Specification) shows the members of the CFBF header and their purpose:
When taken together as a single stream the collection of FAT sectors define the status and linkage of every sector in the file. Each entry in the FAT is 4 bytes in length and contains the sector number of the next sector in a FAT chain or one of the following special values:
The Range Lock Sector must exist in files greater than 2 GB in size, and must not exist in files smaller than 2 GB. The Range Lock Sector must contain the byte range 0x7FFFFF00 to 0x7FFFFFFF in the file. This area is reserved by Microsoft's COM implementation for storing byte-range locking information for concurrent access.
"Apache POI – POIFS". POI Project. Archived from the original on 26 April 2011. Retrieved 10 May 2011. https://web.archive.org/web/20110426150340/http://poi.apache.org/poifs/index.html ↩
"How to convert documents between LibreOffice and Microsoft Office file formats on Linux". Archived from the original on 21 September 2019. Retrieved 25 November 2016. https://web.archive.org/web/20190921163547/https://linuxconfig.org/how-to-convert-documents-between-libreoffice-and-microsoft-office-file-formats-on-linux ↩
"Compound Files (Windows)". Microsoft Developers Network (MSDN) library – COM SDK. Microsoft Corporation. 20 November 2008. Retrieved 23 September 2009. http://msdn.microsoft.com/en-us/library/aa378938%28VS.85%29.aspx ↩
"Containers: Compound Files". Microsoft Developers Network (MSDN) library – Visual Studio 2008 documentation. Microsoft Corporation. Retrieved 23 September 2009. http://msdn.microsoft.com/en-us/library/ydd3k45e.aspx ↩
"Understand Compound Files". Microsoft Developers Network (MSDN) library – ActiveDirectory Rights Management. 25 June 2009. Retrieved 23 September 2009. http://msdn.microsoft.com/en-us/library/cc542545%28VS.85%29.aspx ↩
"Microsoft Compound File Binary File Format, Version 4". www.loc.gov. 28 January 2020. Retrieved 13 June 2024. https://www.loc.gov/preservation/digital/formats/fdd/fdd000392.shtml ↩
AMW Association (formerly AAF Association) Archived 15 August 2000 at the Wayback Machine http://www.aafassociation.org ↩