# file_create_with_client

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

```c
struct client_file * file_create_with_client(struct client *c, int stream, client_file_cb cb, void *cbdata)
```

## Parameters

- `c` (`struct client *`)
- `stream` (`int`)
- `cb` (`client_file_cb`)
- `cbdata` (`void *`)

## Called by

- [`file_error`](/en/tmux/latest/reference/c-function-file_error/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/file.c#L273)
- [`file_print_buffer`](/en/tmux/latest/reference/c-function-file_print_buffer/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/file.c#L243)
- [`file_read`](/en/tmux/latest/reference/c-function-file_read/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/file.c#L378)
- [`file_vprint`](/en/tmux/latest/reference/c-function-file_vprint/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/file.c#L216)
- [`file_write`](/en/tmux/latest/reference/c-function-file_write/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/file.c#L304)

## Calls

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

## 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`](/en/tmux/latest/reference/c-struct-client/) (struct)
- [`CLIENT_ATTACHED`](/en/tmux/latest/reference/c-define-tmux-h-client_attached/) (constant)
- [`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_file.data`](/en/tmux/latest/reference/c-struct-client_file-data/) (attribute)
- [`client.files`](/en/tmux/latest/reference/c-struct-client-files/) (attribute)
- [`client.flags`](/en/tmux/latest/reference/c-struct-client-flags/) (attribute)
- [`client_file.peer`](/en/tmux/latest/reference/c-struct-client_file-peer/) (attribute)
- [`client.peer`](/en/tmux/latest/reference/c-struct-client-peer/) (attribute)
- [`client_file.references`](/en/tmux/latest/reference/c-struct-client_file-references/) (attribute)
- [`client.references`](/en/tmux/latest/reference/c-struct-client-references/) (attribute)
- [`client_file.stream`](/en/tmux/latest/reference/c-struct-client_file-stream/) (attribute)
- [`client_file.tree`](/en/tmux/latest/reference/c-struct-client_file-tree/) (attribute)
