# server.Server.save_buffer

- **Module:** server.Server
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/server.rs#L973
- **Page:** https://libtmux.org/en/rs/latest/reference/server-server-save_buffer/

```
server.Server.save_buffer(self, name: Option<&str>, path: impl AsRef<Path>) -> Result<(), Error>
```

Write a paste buffer to a file, letting tmux do the writing.

The counterpart to [`Self::load_buffer`], and the same reasoning: the
bytes never cross a command line, so a buffer larger than an argument
can hold still round-trips. tmux writes as the user running the
server.

# Errors

Returns an error when the buffer is missing or tmux cannot write the
path.
