iori

Async file I/O through io_uring

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version 0.2.0
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:27

Tags

Authors

  • fox0430

Installation

nimble install iori
choosenim install iori
git clone https://github.com/fox0430/iori

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
iori - - - - - - -

Dependencies

Package Version Optional
nim >= 2.0.2 No

Source

Repository https://github.com/fox0430/iori
Homepage https://github.com/fox0430/iori
Registry Source nimble_official

README

Iori

Async file I/O library in Nim using io_uring.

Requirements

  • Nim >= 2.0.2
  • Linux 5.6+ (6.1+ recommended)

Install

nimble install iori

Usage

# examples/simple.nim

import pkg/iori

proc main() {.async.} =
  let io = newUringFileIO()

  # Write
  await io.writeFileString("/tmp/hello.txt", "Hello, iori!")

  # Read
  let content = await io.readFileString("/tmp/hello.txt")
  echo content

  io.close()

waitFor main()

Compile with an async backend:

# Use std/asyncdispatch
nim c -d:asyncBackend=asyncdispatch -r examples/simple.nim

# Use Chronos
nimble install chronos
nim c -d:asyncBackend=chronos -r examples/simple.nim

Documentation

https://fox0430.github.io/iori/iori.html

See also

If you use Chronos and want broader platform support, check out chronos-file. It is an async file I/O library for Chronos that works on POSIX systems using pread/pwrite, with an optional io_uring backend (Linux 5.6+) for truly async seekable I/O.

TODO

  • SQ polling (IORING_SETUP_SQPOLL)
  • Additional opcodes: READV, WRITEV, FALLOCATE, UNLINKAT, MKDIRAT

License

MIT