# Archive class

Namespace: [GrasshopperIO.DataBase](https://developer.rhino3d.com/api/gh2/namespace/grasshopperio.database.md) · Assembly: [GrasshopperIO](https://developer.rhino3d.com/api/gh2/assembly/grasshopperio.md)

```cs
public class Archive : ICloneable
```

This class represents a complete file. Grasshopper2 files are essentially zip-archives containing a mixture of textual, binary and node-based entries.

## Constructors

- [Archive](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.archive/ctor.md): Create a new, empty archive.

## Fields

- [FileExtension](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.archive/fileextension.md): (static) Gets the file extension used for Grasshopper 2.0 files (minus the period). The extension is "ghz" which stands for GrassHopperZip(ped).
- [PathSeparator](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.archive/pathseparator.md): (static) Gets the folder separator character used in Archive paths. You can use forward slahes, backslashes or vertical bars in your own notation though.

## Properties

- [Compression](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.archive/compression.md): Gets or sets the compression level to use when writing this archive to a file.
- [Count](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.archive/count.md): Gets the number of distinct entries in this archive.
- [Errors](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.archive/errors.md): Enumerate over all error messages.
- [HasErrors](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.archive/haserrors.md): Gets whether any error messages have been logged.
- [HasNotes](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.archive/hasnotes.md): Gets whether any informational messages have been logged.
- [HasWarnings](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.archive/haswarnings.md): Gets whether any warning messages have been logged.
- [Location](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.archive/location.md): Gets the location associated with this archive. This will only be set when the archive is read or written from/to file.
- [MessageCount](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.archive/messagecount.md): Gets the number of messages.
- [Notes](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.archive/notes.md): Enumerate over all informational messages.
- [Paths](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.archive/paths.md): Enumerate over all entry paths in this archive.
- [Warnings](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.archive/warnings.md): Enumerate over all warning messages.

## Indexers

- [this[]](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.archive/item.md): Get the entry at the given path.

## Methods

- [AddData](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.archive/adddata.md): Add byte-array content to this archive.
- [AddDataUnsafe](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.archive/adddataunsafe.md): Add byte-array content to this archive without copying. Only use this method if you know there is no chance of the byte array being shared.
- [AddRoot](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.archive/addroot.md): Add a root node to this archive.
- [AddText](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.archive/addtext.md): Add text content to this archive.
- [ClearMessages](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.archive/clearmessages.md): Wipe all messages.
- [Clone](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.archive/clone.md): Create a deep copy of this archive in memory.
- [EnumerateAndExecute](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.archive/enumerateandexecute.md): Enumerate over all elements in this archive and invoke a delegate for each.
- [GetData](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.archive/getdata.md): Get the byte-array associated with the given path.
- [GetDataUnsafe](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.archive/getdataunsafe.md): Get the byte-array associated with the given path. This method provides direct access to the internal array without duplication, so only use it if you're not going to modify this array.
- [GetRoot](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.archive/getroot.md): Get the root node associated with the given path.
- [GetText](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.archive/gettext.md): Try to get the text associated with the given path.
- [Read](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.archive/read.md): (2 overloads, static) Read a file and store its contents in a new archive.
- [RecordError](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.archive/recorderror.md): Add an error message to this archive.
- [RecordNote](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.archive/recordnote.md): Add an informational message to this archive.
- [RecordWarning](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.archive/recordwarning.md): Add a warning message to this archive.
- [Remove](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.archive/remove.md): Remove an entry from this archive.
- [ICloneable.Clone](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.archive/system-icloneable-clone.md): Creates a new object that is a copy of the current instance.
- [Write](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.archive/write.md): (2 overloads) An overload that writes this archive to a file on the disk, and reports the number of written bytes.
