# CabArchiveWriter

Creates a deterministic, standalone Microsoft cabinet with one MSZIP folder.

Class 

`OfficeIMO.Archives`

**Namespace**

`OfficeIMO.Archives`

**Assembly**

`OfficeIMO.Archives`

**Source revision**

`273d35d5ba8a` with working tree changes

**Source**

[CabArchiveWriter.cs:29](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Archives/CabArchiveWriter.cs#L29)

**Modifiers**

static

Creates a deterministic, standalone Microsoft cabinet with one MSZIP folder.

## Inheritance

- object
- CabArchiveWriter

## Remarks

Member order follows the source sequence. Cabinet members are files, with portable relative names containing up to 255 UTF-8 bytes. File sources are consumed once and compressed into private staging storage before the destination receives any data.

Filter members 

Show inherited

## Methods

Create 2 overloads

`public static void Create(Stream destination, IEnumerable<ArchiveWriteEntry> entries, CabArchiveWriterOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-create-io-stream-collections-generic-ienumerable-officeimo-archives-archivewriteentry-officeimo-archives-cabarchivewriteroptions-threading-cancellationtoken)

[CabArchiveWriter.cs:29](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Archives/CabArchiveWriter.cs#L29)

Writes to the current position of a writable stream and leaves it open. The stream need not seek. Cancellation is checked before publication. Once writing begins, an I/O failure can leave a partial write on the caller-owned stream.

Parameters

**destination System.IO.Stream required**

**entries System.Collections.Generic.IEnumerable<OfficeIMO.Archives.ArchiveWriteEntry> required**

**options OfficeIMO.Archives.CabArchiveWriterOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

`public static void Create(string destinationPath, IEnumerable<ArchiveWriteEntry> entries, CabArchiveWriterOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-create-string-collections-generic-ienumerable-officeimo-archives-archivewriteentry-officeimo-archives-cabarchivewriteroptions-threading-cancellationtoken)

[CabArchiveWriter.cs:34](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Archives/CabArchiveWriter.cs#L34)

Atomically creates a cabinet at a new path. An existing destination causes an I/O error.

Parameters

**destinationPath string required**

**entries System.Collections.Generic.IEnumerable<OfficeIMO.Archives.ArchiveWriteEntry> required**

**options OfficeIMO.Archives.CabArchiveWriterOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

CreateFromDirectory 2 overloads

`public static void CreateFromDirectory(string sourceDirectory, Stream destination, CabArchiveWriterOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-createfromdirectory-string-io-stream-officeimo-archives-cabarchivewriteroptions-threading-cancellationtoken)

[CabArchiveWriter.cs:42](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Archives/CabArchiveWriter.cs#L42)

Writes directory files in ordinal relative-path order. Empty directories are not recorded.

Parameters

**sourceDirectory string required**

**destination System.IO.Stream required**

**options OfficeIMO.Archives.CabArchiveWriterOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

`public static void CreateFromDirectory(string sourceDirectory, string destinationPath, CabArchiveWriterOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-createfromdirectory-string-string-officeimo-archives-cabarchivewriteroptions-threading-cancellationtoken)

[CabArchiveWriter.cs:50](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Archives/CabArchiveWriter.cs#L50)

Atomically writes directory files in ordinal relative-path order to a new cabinet path. Empty directories are not recorded.

Parameters

**sourceDirectory string required**

**destinationPath string required**

**options OfficeIMO.Archives.CabArchiveWriterOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

<!-- PowerForge markdown artifact sha256:97AA80E5FAC2FDA80129D197BD26A829AF023AE80DED83BDDCDB529C6D0B88A6 -->
