A cross-platform C++11 header-only library for memory-mapped file I/O with zero dependencies.
mio is a cross-platform, header-only C++11 library for memory-mapped file I/O. It provides a lightweight, efficient interface for mapping files into memory without requiring Boost or other dependencies. The library solves the need for portable, low-overhead file access with support for existing file handles and automatic page alignment.
C++ developers working on performance-sensitive applications that require efficient file I/O, such as data processing tools, game engines, or system utilities.
Developers choose mio for its simplicity, zero dependencies, and cross-platform consistency. It offers a cleaner, more flexible API than Boost.Iostreams, with lower overhead and better support for advanced use cases like mapping with open file descriptors.
Cross-platform C++11 header-only library for memory mapped file IO
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Easily includable without compilation or linking steps; just add the header files to any C++ project, simplifying setup and reducing build complexity.
Works uniformly on Windows, Linux, and other systems, providing a portable API that eliminates platform-specific memory mapping code.
Does not rely on Boost or other libraries, keeping the project lightweight and avoiding additional dependency management overhead.
Supports mapping with already open file descriptors, a feature missing in Boost.Iostreams, as highlighted in the README for advanced use cases.
Requires users to ensure files exist and are non-empty before mapping, which can lead to runtime errors if not manually checked, increasing boilerplate code.
Constructors throw exceptions and mandate exception support, forcing projects compiled with -fno-exceptions to use less intuitive factory functions or map methods.
Does not validate file descriptor permissions when mapping, potentially causing silent failures that users must handle via error codes, adding complexity.
mio is an open-source alternative to the following products: