# LibTmux.TmuxBuffers.SaveAsync

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** C#
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/cf34b255c896d19a97e7d7fabea58609c916012d/src/LibTmux/Buffers/TmuxBuffers.cs#L55
- **Page:** https://libtmux.org/en/csharp/latest/reference/libtmux-tmuxbuffers-saveasync/

tmux command: [`save-buffer`](/en/tmux/latest/manual/save-buffer/)

```
LibTmux.TmuxBuffers.SaveAsync(path: string, name: string?, append: bool, cancellationToken: CancellationToken) -> Task
```

Writes a buffer to a file.

## Parameters

- `path` (`string`): The file to write.
- `name` (`string?`): The buffer to write, or null for the most recent.
- `append` (`bool`): Whether the buffer joins what the file already holds.
- `cancellationToken` (`CancellationToken`): Cancels the tmux command.

## Returns

A task that completes once tmux has written it.

## Raises

- [`ArgumentException`](https://learn.microsoft.com/dotnet/api/system.argumentexception): <paramref name="path" /> is blank.
