> ## Documentation Index
> Fetch the complete documentation index at: https://botmesh.afaya.com.co/llms.txt
> Use this file to discover all available pages before exploring further.

# FileDurabilityOptions

> Interface exported by @botmesh/core.

Defined in: [durability/file.ts:25](https://github.com/andresayac/botmesh/blob/main/packages/core/src/durability/file.ts#L25)

Options of [FileDurability.open](https://botmesh.afaya.com.co/api/core/classes/FileDurability.md#open).

## Properties

### lock?

```ts theme={null}
lock?: boolean;
```

Defined in: [durability/file.ts:27](https://github.com/andresayac/botmesh/blob/main/packages/core/src/durability/file.ts#L27)

Skip the advisory lock file (only when something else guarantees a single writer).

***

### lockWaitMs?

```ts theme={null}
lockWaitMs?: number;
```

Defined in: [durability/file.ts:32](https://github.com/andresayac/botmesh/blob/main/packages/core/src/durability/file.ts#L32)

How long `open()` waits for a lock file that another opener has created but not written
its pid to yet (default 2000 ms). An empty lock older than 10 s is treated as stale.

***

### appendLog?

```ts theme={null}
appendLog?: 
  | boolean
  | {
  compactEvery?: number;
  compactBytes?: number;
  fsync?: boolean;
};
```

Defined in: [durability/file.ts:40](https://github.com/andresayac/botmesh/blob/main/packages/core/src/durability/file.ts#L40)

Append-only journal (`<file>.log`): each write appends one line instead of rewriting the
whole snapshot, and the snapshot is rewritten (and the log truncated) every
`compactEvery` entries (1000) or `compactBytes` (4 MiB). `true` uses those defaults;
`false`/omitted keeps the whole-snapshot behaviour. A leftover log is always replayed
(and folded into a snapshot) on open, even with this off.

***

### fsync?

```ts theme={null}
fsync?: boolean;
```

Defined in: [durability/file.ts:47](https://github.com/andresayac/botmesh/blob/main/packages/core/src/durability/file.ts#L47)

`fsync` every snapshot before it replaces the previous one (and the directory after the
rename, where the platform allows it), so a power loss cannot leave an empty or partial
journal. Also the default of `appendLog.fsync`. Default `false`: the write is atomic
(temp file + rename) but may still sit in the OS cache when the machine loses power.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.