# file_read

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/file.c#L356
- **Page:** https://libtmux.org/en/tmux/3.2a/reference/c-function-file_read/

```c
void file_read(struct client *c, const char *path, client_file_cb cb, void *cbdata)
```

## Parameters

- `c` (`struct client *`)
- `path` (`const char *`)
- `cb` (`client_file_cb`)
- `cbdata` (`void *`)

## Called by

- [`cmd_load_buffer_exec`](/en/tmux/3.2a/reference/c-function-cmd-load-buffer-c-cmd_load_buffer_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-load-buffer.c#L109)
- [`cmd_source_file_done`](/en/tmux/3.2a/reference/c-function-cmd-source-file-c-cmd_source_file_done/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-source-file.c#L108)
- [`cmd_source_file_exec`](/en/tmux/3.2a/reference/c-function-cmd-source-file-c-cmd_source_file_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-source-file.c#L193)
- [`window_pane_start_input`](/en/tmux/3.2a/reference/c-function-window_pane_start_input/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window.c#L1565)

## Calls

- [`file_create_with_client`](/en/tmux/3.2a/reference/c-function-file_create_with_client/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/file.c#L368)
- [`file_fire_done`](/en/tmux/3.2a/reference/c-function-file_fire_done/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/file.c#L426)
- [`file_get_path`](/en/tmux/3.2a/reference/c-function-file-c-file_get_path/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/file.c#L382)
- [`proc_send`](/en/tmux/3.2a/reference/c-function-proc_send/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/file.c#L417)
- [`xmalloc`](/en/tmux/3.2a/reference/c-function-xmalloc/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/file.c#L413)
- [`xstrdup`](/en/tmux/3.2a/reference/c-function-xstrdup/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/file.c#L369)

## Referenced declarations

- [`client_file.buffer`](/en/tmux/3.2a/reference/c-struct-client_file-buffer/) (attribute)
- [`client`](/en/tmux/3.2a/reference/c-struct-client/) (struct)
- [`CLIENT_ATTACHED`](/en/tmux/3.2a/reference/c-define-tmux-h-client_attached/) (constant)
- [`CLIENT_CONTROL`](/en/tmux/3.2a/reference/c-define-tmux-h-client_control/) (constant)
- [`client_file_cb`](/en/tmux/3.2a/reference/c-typedef-client_file_cb/) (typealias)
- [`client_file.error`](/en/tmux/3.2a/reference/c-struct-client_file-error/) (attribute)
- [`msg_read_open.fd`](/en/tmux/3.2a/reference/c-struct-msg_read_open-fd/) (attribute)
- [`file_next_stream`](/en/tmux/3.2a/reference/c-variable-file-c-file_next_stream/) (attribute)
- [`client.flags`](/en/tmux/3.2a/reference/c-struct-client-flags/) (attribute)
- [`MSG_READ_OPEN`](/en/tmux/3.2a/reference/c-enum-msgtype-msg_read_open/) (constant)
- [`client_file.path`](/en/tmux/3.2a/reference/c-struct-client_file-path/) (attribute)
- [`client_file.peer`](/en/tmux/3.2a/reference/c-struct-client_file-peer/) (attribute)
- [`client_file.stream`](/en/tmux/3.2a/reference/c-struct-client_file-stream/) (attribute)
- [`msg_read_open.stream`](/en/tmux/3.2a/reference/c-struct-msg_read_open-stream/) (attribute)
