# file_create_with_peer

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/file.c#L80
- **Page:** https://libtmux.org/en/tmux/latest/reference/c-function-file_create_with_peer/

```c
struct client_file * file_create_with_peer(struct tmuxpeer *peer, struct client_files *files, int stream, client_file_cb cb, void *cbdata)
```

## Parameters

- `peer` (`struct tmuxpeer *`)
- `files` (`struct client_files *`)
- `stream` (`int`)
- `cb` (`client_file_cb`)
- `cbdata` (`void *`)

## Called by

- [`file_read_open`](/en/tmux/latest/reference/c-function-file_read_open/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/file.c#L755)
- [`file_write_open`](/en/tmux/latest/reference/c-function-file_write_open/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/file.c#L594)

## Calls

- [`fatalx`](/en/tmux/latest/reference/c-function-fatalx/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/file.c#L92)
- [`xcalloc`](/en/tmux/latest/reference/c-function-xcalloc/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/file.c#L85)

## Referenced declarations

- [`client_file.buffer`](/en/tmux/latest/reference/c-struct-client_file-buffer/) (attribute)
- [`client_file.c`](/en/tmux/latest/reference/c-struct-client_file-c/) (attribute)
- [`client_file.cb`](/en/tmux/latest/reference/c-struct-client_file-cb/) (attribute)
- [`client_file`](/en/tmux/latest/reference/c-struct-client_file/) (struct)
- [`client_file_cb`](/en/tmux/latest/reference/c-typedef-client_file_cb/) (typealias)
- [`client_files`](/en/tmux/latest/reference/c-struct-client_files/) (struct)
- [`client_file.data`](/en/tmux/latest/reference/c-struct-client_file-data/) (attribute)
- [`client_file.peer`](/en/tmux/latest/reference/c-struct-client_file-peer/) (attribute)
- [`client_file.references`](/en/tmux/latest/reference/c-struct-client_file-references/) (attribute)
- [`client_file.stream`](/en/tmux/latest/reference/c-struct-client_file-stream/) (attribute)
- [`tmuxpeer`](/en/tmux/latest/reference/c-struct-tmuxpeer/) (struct)
- [`client_file.tree`](/en/tmux/latest/reference/c-struct-client_file-tree/) (attribute)
