## What is OpenMCDF ?

OpenMCDF is a 100% managed .net component that allows client applications to manipulate COM structured storage files, also known as Microsoft Compound Document Format files.

## Ok, so what's 'structured storage' anyway ?

This file format is used under the hood by a lot of applications: the files created by Microsoft Office until the 2007 product release are all structured storage files. They include multiple streams of information (document summary, user data) in a single physical container (the file). Also the omnipresent Thumbs.db, used by Windows as thumbnails cache, is a structured storage file.

## How does it work ?

OpenMCDF makes available to the developer an easy interface to read, write, add and remove structured storage primitives. Items are organized in a hierarchical tree where 'storage' nodes act like a directory and 'stream' nodes like a file. Developers can use OpenMCDF to view storages and streams, traverse hierarchical trees of items, explore existing compound file and modify them or create a new compound file from scratch.

## ...mmm yes, but I've already seen a lot of wrappers...

- OpenMCDF is NOT a wrapper component: it's 100% pure C#, nothing else.
- There are NO ActiveX, COM or P/Invoke dependencies
- OpenMCDF supports large files and Version 4 of Compound File Format
- Low memory footprint: incremental data updating and partial stream data reading
- Works on Mono platform out of the box

## Well, can I try it ?

You can get OpenMCDF from Github or use NuGet to install it into your projects. OpenMCDF is MPL 2.0 licensed.

### The structured storage entries tree

### Sample code to read a stream entry

### Sample code to write a stream entry

### Sample code to traverse entries tree

### Incremental Update

This feature allows to commit changes to file in order to save memory and reduce the size of subsequent write operations. Only data blocks marked as "dirty" will be persisted on the storage media (file or stream) while clean data will stay untouched. This feature is also useful to avoid the need for temporary files while using OpenMCDF.

### Partial data reading

OpenMCDF can load fragments of data streams without a full structure load. That means that if you want to read 100 bytes from a specified offset of a 1 GB stream , you will only need to load 1 sector (usually 512 bytes) of user data and a couple of sectors for FAT indexing.

You will get the required amount of data without being forced to use large buffers