# libtmux:save-buffer

- **Package:** libtmux
- **Language:** Common Lisp
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-lisp/blob/c2e5fc4ed3befda21f45dfa5d5868c38fd138311/src/buffers.lisp#L111
- **Public owner:** libtmux
- **Page:** https://libtmux.org/en/lisp/latest/reference/libtmux-save-buffer/

```
(save-buffer client path &key name append cancel-token timeout output-limit)
```

Save a named or top buffer's bytes to literal PATH; return a COMMAND-OUTCOME.
Overwrite the file unless APPEND is true. Relative paths follow tmux's command
client cwd. Use SHOW-BUFFER for returned bytes. Success records tmux's reported
completion, not independently verified file contents or durability. In particular,
tmux 3.3a can suppress file-write errors. An uncertain write is never retried.
Signals INVALID-ARGUMENT or an operational condition.

## Parameters

- `client`
- `path`
- `name?`
- `append?`
- `cancel-token?`
- `timeout?`
- `output-limit?`

## tmux command

The tmux commands behind `save-buffer`.

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

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_save_buffer_entry`](/en/tmux/latest/reference/c-variable-cmd_save_buffer_entry/) (attribute)
- [`cmd_save_buffer_exec`](/en/tmux/latest/reference/c-function-cmd-save-buffer-c-cmd_save_buffer_exec/) (function)

## Guides

Pages that discuss `save-buffer`.

- [Explicit operations](/en/lisp/latest/guides/operations/)
