# Server.loadBuffer(from:named:)

- **Module:** Server
- **Package:** libtmux-swift
- **Language:** Swift
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-swift/blob/f02a4668570e1cc5198c941413750e021f42c214/Sources/LibTmux/Buffers.swift#L74
- **Page:** https://libtmux.org/reference/swift/server-loadbuffer(from-named-)/

```
Server.loadBuffer(from:named:)(from: String, named: String?) -> ()
```

Fills a buffer from a file, letting tmux read it.

``setBuffer(_:named:)`` carries the text as an argument, which caps it at
whatever the platform allows in an argument vector and — over
``connected(attachingTo:_:)`` — forbids a newline outright, because a
connection sends a command *line*. A path has neither problem: it is
short, and tmux opens the file itself. This is the way to put many lines
into a buffer from a connected server.

The path is resolved by the tmux server, which for a socket on this
machine is this machine.

## Raises

- `TmuxError`
