# tmux_buffer:load/3

- **Package:** libtmux_erlang
- **Language:** Erlang
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-erlang/blob/d1b6308440cf9eb8f6647e7ae434bce60e849368/apps/libtmux_erlang/src/tmux_buffer.erl#L72
- **Page:** https://libtmux.org/en/erlang/latest/reference/tmux_buffer-load-3/

```
load(Server, Name, Bytes)
-spec load(tmux_server:t(),
           binary() | automatic,
           binary()) ->
              {ok, tmux_operation:completed()} |
              {error, map()}.
```

Load binary bytes under a name, or create an automatic buffer. Input may contain NUL. Empty input succeeds without changing the buffer store, including an existing name. The command payload, including argv and stdin, must fit the endpoint's 256 KiB admission limit. See `tmux_server:command/3`.

Returns the completed command result, not a persistent buffer handle. No
clipboard write is requested. Native stored-name rules still apply.

## Parameters

- `Server` (`tmux_server:t()`)
- `Name` (`binary() | automatic`)
- `Bytes` (`binary()`)

## tmux command

The tmux commands behind `load/3`.

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

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_load_buffer_entry`](/en/tmux/latest/reference/c-variable-cmd_load_buffer_entry/) (attribute)
- [`cmd_load_buffer_exec`](/en/tmux/latest/reference/c-function-cmd-load-buffer-c-cmd_load_buffer_exec/) (function)

## Guides

Pages that discuss `load/3`.

- [Preserve byte buffers and paste deliberately](/en/erlang/latest/guides/buffers/)

## In other ports

Fill a paste buffer from a file

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Server.load_buffer`](/en/py/latest/reference/libtmux-server-load_buffer/) (method) |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | [`server.Server.loadBuffer`](/en/ts/latest/reference/server-server-loadbuffer/) (method) |
| Rust | no equivalent on `Server` |
| Go | [`tmux.Server.LoadBuffer`](/en/go/latest/reference/tmux-server-loadbuffer/) (method) |
| Java | no equivalent on `Server` |
| C# | [`LibTmux.TmuxBuffers.LoadAsync`](/en/csharp/latest/reference/libtmux-tmuxbuffers-loadasync/) (method) |
| C++ | [`libtmux::Server::load_buffer`](/en/cxx/latest/reference/libtmux-server-load_buffer/) (method) |
| Swift | [`Server.loadBuffer(from:named:)`](/en/swift/latest/reference/server-loadbuffer(from-named-)/) (method) |
| OCaml | No direct public OCaml equivalent is recorded for this operation. |
| Perl | No dedicated equivalent in the selected Perl surface. Explicit Server::cmd remains available for native tmux commands. |

No equivalent is recorded in Ruby, Lua, PowerShell, Julia, Elixir, Common Lisp, Clojure, Kotlin, Scala or F#.
