MIO is a lightweight buffered I/O library written in C that provides direct control over file reads and writes using UNIX file descriptors, without relying on stdio. It offers deterministic behavior through explicit buffering, user-defined stream objects, and manual memory handling. By exposing simple primitives like myread, mywrite, mygets, and mygetline, it enables efficient data transfer while keeping buffering behavior predictable and transparent.
Language: C
Skills: Low-Level System Programming, Custom I/O Abstractions, Manual Buffer Management, File Descriptor Handling, Stream Interface Design
System-Level File I/O: Interfaces directly with the operating system using raw file descriptors (open, read, write, close) instead of higher-level stdio functions.
Manual Buffer Control: Manages read/write buffers explicitly on the heap, allowing both fully buffered and unbuffered modes depending on performance needs.
Dynamic Memory Management: Allocates and frees memory for buffers and returned strings (mygets, mygetline) without relying on automatic abstractions.
Custom Stream Abstraction: Implements a user-defined stream structure (MIO *) that tracks file state, buffer indices, and access mode, enabling deterministic behavior across reads and writes.