> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://nvidia-cuvs.docs.buildwithfern.com/cuvs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://nvidia-cuvs.docs.buildwithfern.com/cuvs/_mcp/server.

# File Io

_Source header: `cuvs/util/file_io.hpp`_

## Types

<a id="util-fd-streambuf"></a>
### util::fd_streambuf

Streambuf that reads from a POSIX file descriptor

```cpp
class fd_streambuf;
```

<a id="util-fd-istream"></a>
### util::fd_istream

Istream that reads from a POSIX file descriptor

```cpp
class fd_istream;
```

<a id="util-file-descriptor"></a>
### util::file_descriptor

RAII wrapper for POSIX file descriptors

Manages file descriptor lifecycle with automatic cleanup. Non-copyable, move-only.

```cpp
class file_descriptor;
```

<a id="util-buffered-ofstream"></a>
### util::buffered_ofstream

Buffered output stream wrapper

Wraps an std::ostream with a buffer to improve write performance by reducing the number of system calls. Automatically flushes on destruction. Non-copyable, non-movable.

```cpp
class buffered_ofstream;
```