# MountKey class

> A key file the player's pointer names, read for a game that can't be read without one. The pointer's key is an absolute path, and the host reads the file into Externals.Key before it calls Open.

Namespace `EvilEngine.Mounts`, assembly `EvilEngine.Mounts`. Engine commit 4ff877b1.

```csharp
public sealed class MountKey
```

A key file the player's pointer names, read for a game that can't be read without one. The pointer's `key` is an absolute path, and the host reads the file into [Externals.Key](/docs/api/externals#key) before it calls [Open](/docs/api/igameadapter#open).

Reading never throws for a bad path. A key that can't be read keeps its path and says why in [Problem](#problem), with no [Bytes](#bytes), so the adapter can name it in its notes or its `MountException`. No adapter the engine ships reads one: keyed readers are players' own adapters, not first-party ones.

## Members

### Longest (field)

```csharp
public const int Longest = 4096
```

`4096`, the most bytes a key file can hold. A longer file isn't read.

### Path (property)

```csharp
public string Path { get; }
```

The key file's full path, or the text the pointer gave when that isn't an absolute path.

### Bytes (property)

```csharp
public byte[]? Bytes { get; }
```

The file's bytes, or `null` when it couldn't be read.

### Problem (property)

```csharp
public string? Problem { get; }
```

Why the key couldn't be read, or `null` when it was: the path isn't absolute, nothing is there, or it's longer than [Longest](#longest).

### Read (method)

```csharp
public static MountKey Read(string path)
```

Reads the key file at `path`. A path that isn't absolute, a file that isn't there, a folder, and a file longer than [Longest](#longest) each give a key with a [Problem](#problem) rather than an exception.

### ToString (method)

```csharp
public override string ToString()
```

The [Path](#path), with the [Problem](#problem) after it in brackets when there is one. `just mounts` prints it on the key line.
