<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://debianws.lexgopc.com/wiki143/index.php?action=history&amp;feed=atom&amp;title=Compound_File_Binary_Format</id>
	<title>Compound File Binary Format - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://debianws.lexgopc.com/wiki143/index.php?action=history&amp;feed=atom&amp;title=Compound_File_Binary_Format"/>
	<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki143/index.php?title=Compound_File_Binary_Format&amp;action=history"/>
	<updated>2026-10-26T14:26:52Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>http://debianws.lexgopc.com/wiki143/index.php?title=Compound_File_Binary_Format&amp;diff=3962768&amp;oldid=prev</id>
		<title>imported&gt;Frap at 10:29, 11 May 2025</title>
		<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki143/index.php?title=Compound_File_Binary_Format&amp;diff=3962768&amp;oldid=prev"/>
		<updated>2025-05-11T10:29:30Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Short description|Compound document file format}}&lt;br /&gt;
{{Use dmy dates|date=December 2019}}&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Compound File Binary Format&amp;#039;&amp;#039;&amp;#039; (CFBF), also called &amp;#039;&amp;#039;&amp;#039;Compound File&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Compound Document format&amp;#039;&amp;#039;&amp;#039;,&amp;lt;ref&amp;gt;{{cite web|url=http://poi.apache.org/poifs/index.html|title=Apache POI – POIFS|publisher=POI Project|accessdate=10 May 2011|archive-url=https://web.archive.org/web/20110426150340/http://poi.apache.org/poifs/index.html|archive-date=26 April 2011|url-status=dead}}&amp;lt;/ref&amp;gt; or &amp;#039;&amp;#039;&amp;#039;Composite Document File V2&amp;#039;&amp;#039;&amp;#039;&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
  |url=https://linuxconfig.org/how-to-convert-documents-between-libreoffice-and-microsoft-office-file-formats-on-linux&lt;br /&gt;
  |title=How to convert documents between LibreOffice and Microsoft Office file formats on Linux&lt;br /&gt;
  |accessdate=25 November 2016&lt;br /&gt;
  |archive-url=https://web.archive.org/web/20190921163547/https://linuxconfig.org/how-to-convert-documents-between-libreoffice-and-microsoft-office-file-formats-on-linux&lt;br /&gt;
  |archive-date=21 September 2019&lt;br /&gt;
  |url-status=dead&lt;br /&gt;
  }}&amp;lt;/ref&amp;gt; (CDF), is a [[compound document|compound]] [[document file format]] for storing numerous files and streams within a single file on a disk. CFBF is developed by [[Microsoft]] and is an implementation of Microsoft [[COM Structured Storage]].&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
  |url=http://msdn.microsoft.com/en-us/library/aa378938%28VS.85%29.aspx&lt;br /&gt;
  |title=Compound Files (Windows)&lt;br /&gt;
  |work=Microsoft Developers Network (MSDN) library – COM SDK|publisher=Microsoft Corporation|accessdate=23 September 2009|date=20 November 2008}}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{cite web|url=http://msdn.microsoft.com/en-us/library/ydd3k45e.aspx|title=Containers: Compound Files|work=Microsoft Developers Network (MSDN) library – Visual Studio 2008 documentation|publisher=Microsoft Corporation|accessdate=23 September 2009}}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{cite web|url=http://msdn.microsoft.com/en-us/library/cc542545%28VS.85%29.aspx|title=Understand Compound Files|work=Microsoft Developers Network (MSDN) library – ActiveDirectory Rights Management|accessdate=23 September 2009|date=25 June 2009}}&amp;lt;/ref&amp;gt; The file format is used for storing storage objects and stream objects in a hierarchical structure within a single file.&amp;lt;ref&amp;gt;{{Cite web |date=2020-01-28 |title=Microsoft Compound File Binary File Format, Version 4 |url=https://www.loc.gov/preservation/digital/formats/fdd/fdd000392.shtml |access-date=2024-06-13 |website=www.loc.gov}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Microsoft has opened the format for use by others and it is now used in a variety of programs from [[Microsoft Word]] and [[Microsoft Access]] to Business Objects.{{Citation needed|date=November 2009}} It also forms the basis of the [[Advanced Authoring Format]].&amp;lt;ref&amp;gt;[http://www.aafassociation.org AMW Association (formerly AAF Association)] {{webarchive|url=https://web.archive.org/web/20000815063147/http://www.aafassociation.org/ |date=15 August 2000 }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
At its simplest, the Compound File Binary Format is a container, with little restriction on what can be stored within it.&lt;br /&gt;
&lt;br /&gt;
A CFBF file structure loosely resembles a [[File Allocation Table|FAT]] [[file system]]. The file is partitioned into &amp;#039;&amp;#039;Sectors&amp;#039;&amp;#039; which are chained together with a &amp;#039;&amp;#039;File Allocation Table&amp;#039;&amp;#039; (not to be mistaken with the file system of the same name) which contains chains of sectors related to each file, a &amp;#039;&amp;#039;Directory&amp;#039;&amp;#039; holds information for contained files with a Sector ID (SID) for the starting sector of a chain and so on.&lt;br /&gt;
&lt;br /&gt;
==Structure==&lt;br /&gt;
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.{{Relevance inline|paragraph|reason=MS-CFB standard clearly says that a sector MUST be 512 or 4096, this sentence is encouraging to break the standard|date=November 2016}}&lt;br /&gt;
&lt;br /&gt;
There are several types of sector that may be present in a CFBF file:&lt;br /&gt;
&lt;br /&gt;
* File Allocation Table (FAT) Sector – contains chains of sector indices much as a FAT does in the FAT/FAT32 filesystems&lt;br /&gt;
* MiniFAT Sectors – similar to the FAT but storing chains of mini-sectors within the Mini-Stream&lt;br /&gt;
* Double-Indirect FAT (DIFAT) Sector – contains chains of FAT sector indices&lt;br /&gt;
* Directory Sector – contains directory entries&lt;br /&gt;
* Stream Sector – contains arbitrary file data&lt;br /&gt;
* Range Lock Sector – contains the byte-range locking area of a large file&lt;br /&gt;
&lt;br /&gt;
More detail is given below for the header and each sector type.&lt;br /&gt;
&lt;br /&gt;
===CFBF header format===&lt;br /&gt;
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&amp;#039;s Low-Level Container Specification) shows the members of the CFBF header and their purpose:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
typedef unsigned long ULONG;    // 4 bytes&lt;br /&gt;
typedef unsigned short USHORT;  // 2 bytes&lt;br /&gt;
typedef short OFFSET;           // 2 bytes&lt;br /&gt;
typedef ULONG SECT;             // 4 bytes&lt;br /&gt;
typedef ULONG FSINDEX;          // 4 bytes&lt;br /&gt;
typedef USHORT FSOFFSET;        // 2 bytes&lt;br /&gt;
typedef USHORT WCHAR;           // 2 bytes&lt;br /&gt;
typedef ULONG DFSIGNATURE;      // 4 bytes&lt;br /&gt;
typedef unsigned char BYTE;     // 1 byte&lt;br /&gt;
typedef unsigned short WORD;    // 2 bytes&lt;br /&gt;
typedef unsigned long DWORD;    // 4 bytes&lt;br /&gt;
typedef ULONG SID;              // 4 bytes&lt;br /&gt;
typedef GUID CLSID;             // 16 bytes&lt;br /&gt;
&lt;br /&gt;
struct StructuredStorageHeader { // [offset from start (bytes), length (bytes)]&lt;br /&gt;
    BYTE _abSig[8];             // [00H,08] {0xd0, 0xcf, 0x11, 0xe0, 0xa1, 0xb1,&lt;br /&gt;
                                // 0x1a, 0xe1} for current version&lt;br /&gt;
    CLSID _clsid;               // [08H,16] reserved must be zero (WriteClassStg/&lt;br /&gt;
                                // GetClassFile uses root directory class id)&lt;br /&gt;
    USHORT _uMinorVersion;      // [18H,02] minor version of the format: 33 is&lt;br /&gt;
                                // written by reference implementation&lt;br /&gt;
    USHORT _uDllVersion;        // [1AH,02] major version of the dll/format: 3 for&lt;br /&gt;
                                // 512-byte sectors, 4 for 4 KB sectors&lt;br /&gt;
    USHORT _uByteOrder;         // [1CH,02] 0xFFFE: indicates Intel byte-ordering&lt;br /&gt;
    USHORT _uSectorShift;       // [1EH,02] size of sectors in power-of-two;&lt;br /&gt;
                                // typically 9 indicating 512-byte sectors&lt;br /&gt;
    USHORT _uMiniSectorShift;   // [20H,02] size of mini-sectors in power-of-two;&lt;br /&gt;
                                // typically 6 indicating 64-byte mini-sectors&lt;br /&gt;
    USHORT _usReserved;         // [22H,02] reserved, must be zero&lt;br /&gt;
    ULONG _ulReserved1;         // [24H,04] reserved, must be zero&lt;br /&gt;
    FSINDEX _csectDir;          // [28H,04] must be zero for 512-byte sectors,&lt;br /&gt;
                                // number of SECTs in directory chain for 4 KB&lt;br /&gt;
                                // sectors&lt;br /&gt;
    FSINDEX _csectFat;          // [2CH,04] number of SECTs in the FAT chain&lt;br /&gt;
    SECT _sectDirStart;         // [30H,04] first SECT in the directory chain&lt;br /&gt;
    DFSIGNATURE _signature;     // [34H,04] signature used for transactions; must&lt;br /&gt;
                                // be zero. The reference implementation&lt;br /&gt;
                                // does not support transactions&lt;br /&gt;
    ULONG _ulMiniSectorCutoff;  // [38H,04] maximum size for a mini stream;&lt;br /&gt;
                                // typically 4096 bytes&lt;br /&gt;
    SECT _sectMiniFatStart;     // [3CH,04] first SECT in the MiniFAT chain&lt;br /&gt;
    FSINDEX _csectMiniFat;      // [40H,04] number of SECTs in the MiniFAT chain&lt;br /&gt;
    SECT _sectDifStart;         // [44H,04] first SECT in the DIFAT chain&lt;br /&gt;
    FSINDEX _csectDif;          // [48H,04] number of SECTs in the DIFAT chain&lt;br /&gt;
    SECT _sectFat[109];         // [4CH,436] the SECTs of first 109 FAT sectors&lt;br /&gt;
 };&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===File Allocation Table (FAT) sectors===&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
* {{Mono|FREESECT}} ({{Mono|0xFFFFFFFF}}) – denotes an unused sector&lt;br /&gt;
* {{Mono|ENDOFCHAIN}} ({{Mono|0xFFFFFFFE}}) – marks the last sector in a FAT chain&lt;br /&gt;
* {{Mono|FATSECT}} ({{Mono|0xFFFFFFFD}}) – marks a sector used to store part of the FAT&lt;br /&gt;
* {{Mono|DIFSECT}} ({{Mono|0xFFFFFFFC}}) – marks a sector used to store part of the DIFAT&lt;br /&gt;
&lt;br /&gt;
===Range Lock Sector===&lt;br /&gt;
{{Expand section|date=November 2009}}&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Range Lock Sector&amp;#039;&amp;#039;&amp;#039; must exist in files greater than 2&amp;amp;nbsp;GB in size, and must not exist in files smaller than 2&amp;amp;nbsp;GB.  The Range Lock Sector must contain the byte range {{Mono|0x7FFFFF00}} to {{Mono|0x7FFFFFFF}} in the file.  This area is reserved by Microsoft&amp;#039;s COM implementation for storing byte-range locking information for concurrent access.&lt;br /&gt;
&lt;br /&gt;
===Glossary===&lt;br /&gt;
* &amp;#039;&amp;#039;FAT&amp;#039;&amp;#039; – File Allocation Table; also known as &amp;#039;&amp;#039;SAT&amp;#039;&amp;#039; – Sector Allocation Table&lt;br /&gt;
* &amp;#039;&amp;#039;DIFAT&amp;#039;&amp;#039; – Double-Indirect File Allocation Table&lt;br /&gt;
* &amp;#039;&amp;#039;FAT Chain&amp;#039;&amp;#039; – a group of FAT entries which indicate the Sectors allocated to a Stream in the file&lt;br /&gt;
* &amp;#039;&amp;#039;Stream&amp;#039;&amp;#039; – a virtual file which occupies a number of Sectors within the CFBF&lt;br /&gt;
* &amp;#039;&amp;#039;Sector&amp;#039;&amp;#039; – the unit of allocation within the CFBF, usually 512 or 4096 Bytes in length&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[COM Structured Storage]]&lt;br /&gt;
* [[Advanced Authoring Format]] (AAF)&lt;br /&gt;
* [[Cabinet (file format)]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
* {{cite web&lt;br /&gt;
 | accessdate = 6 July 2019&lt;br /&gt;
 | url = https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-cfb/53989ce4-7b05-4f8d-829b-d08d6148375b&lt;br /&gt;
 | title = [MS-CFB]: Compound File Binary File Format&lt;br /&gt;
 | publisher = Microsoft&lt;br /&gt;
 }}&lt;br /&gt;
* {{cite web&lt;br /&gt;
 | accessdate = 22 May 2006&lt;br /&gt;
&lt;br /&gt;
 | url = http://sc.openoffice.org/compdocfileformat.pdf&lt;br /&gt;
 | title = Microsoft Compound Document File Format&lt;br /&gt;
 | work = OpenOffice.org CFBF description&lt;br /&gt;
 }}&lt;br /&gt;
* {{cite web&lt;br /&gt;
 | accessdate = 22 May 2006&lt;br /&gt;
 | url = http://www.amwa.tv/downloads/specifications/aafcontainerspec-v1.0.1.pdf&lt;br /&gt;
 | title = Advanced Authoring Format Low-Level Container Specification&lt;br /&gt;
 | work = Microsoft Structured Storage version 3 specification (PDF)&lt;br /&gt;
 | archive-url = https://web.archive.org/web/20110809045600/http://www.amwa.tv/downloads/specifications/aafcontainerspec-v1.0.1.pdf&lt;br /&gt;
 | archive-date = 9 August 2011&lt;br /&gt;
 | url-status = dead&lt;br /&gt;
 }}&lt;br /&gt;
* {{cite web&lt;br /&gt;
 | accessdate = 6 July 2019&lt;br /&gt;
 | url = https://www.loc.gov/preservation/digital/formats/fdd/fdd000380.shtml&lt;br /&gt;
 | title = Microsoft Compound File Binary File Format, Version 3&lt;br /&gt;
 | publisher = Library of Congress, Digital Formats web site&lt;br /&gt;
 }}&lt;br /&gt;
&lt;br /&gt;
[[Category:Computer file formats]]&lt;br /&gt;
[[Category:Digital container formats]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Frap</name></author>
	</entry>
</feed>