# file_read

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

```c
struct client_file * 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.7c/reference/c-function-cmd-load-buffer-c-cmd_load_buffer_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-load-buffer.c#L109)
- [`cmd_source_file_done`](/en/tmux/3.7c/reference/c-function-cmd-source-file-c-cmd_source_file_done/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-source-file.c#L128)
- [`cmd_source_file_exec`](/en/tmux/3.7c/reference/c-function-cmd-source-file-c-cmd_source_file_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-source-file.c#L249)
- [`window_pane_start_input`](/en/tmux/3.7c/reference/c-function-window_pane_start_input/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window.c#L1834)

## Calls

- [`file_create_with_client`](/en/tmux/3.7c/reference/c-function-file_create_with_client/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/file.c#L378)
- [`file_fire_done`](/en/tmux/3.7c/reference/c-function-file_fire_done/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/file.c#L441)
- [`file_get_path`](/en/tmux/3.7c/reference/c-function-file-c-file_get_path/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/file.c#L392)
- [`proc_send`](/en/tmux/3.7c/reference/c-function-proc_send/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/file.c#L430)
- [`xmalloc`](/en/tmux/3.7c/reference/c-function-xmalloc/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/file.c#L426)
- [`xstrdup`](/en/tmux/3.7c/reference/c-function-xstrdup/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/file.c#L379)

## Referenced declarations

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