1
2
3
4
5
6
7
8
9
10
11
12
13
14
open Eio.Std
type rw_ty = [`Unix_fd | Eio.File.rw_ty]
type ro_ty = [`Unix_fd | Eio.File.ro_ty]
let open_type s = (s : rw_ty r :> [< rw_ty] r)
let import_rw ~sw ~close_unix fd =
let fd = Fd.of_unix ~sw ~close_unix fd in
open_type @@ Effect.perform (Private.Import_file fd)
let import_ro = import_rw