Block device abstraction for OCaml 5 with Eio direct-style I/O and Bytesrw integration
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ocaml-linkedin: apply dune fmt

Pure formatting changes from `dune fmt`: doc comment placement moves
from above the binding to below it for `type`s, multi-line `match`
expressions collapse onto one line where they fit, and infix operator
applications pick up spaces (`Soup.($?)` -> `Soup.( $? )`). No
semantic changes.

+22 -3
+15 -3
README.md
··· 19 19 20 20 ## Installation 21 21 22 + Install with opam: 23 + 24 + ```sh 25 + $ opam install block 22 26 ``` 23 - opam install block 27 + 28 + If opam cannot find the package, it may not yet be released in the public 29 + `opam-repository`. Add the overlay repository, then install it: 30 + 31 + ```sh 32 + $ opam repo add samoht https://tangled.org/gazagnaire.org/opam-overlay.git 33 + $ opam update 34 + $ opam install block 24 35 ``` 25 36 26 37 ## Usage 27 38 28 39 ```ocaml 29 - let () = 40 + let run () = 30 41 Eio_main.run @@ fun env -> 31 42 Eio.Switch.run @@ fun sw -> 43 + let fs = Eio.Stdenv.fs env in 32 44 (* Create a file-backed block device *) 33 45 let blk = 34 46 Block.of_file ~sw 35 - Eio.Path.(env#fs / "disk.img") 47 + Eio.Path.(fs / "disk.img") 36 48 ~sector_size:512 ~create:1000L () 37 49 in 38 50 let info = Block.info blk in
+1
block.opam
··· 18 18 "fmt" {>= "0.9"} 19 19 "alcotest" {with-test} 20 20 "eio_main" {with-test} 21 + "mdx" {with-test} 21 22 "alcobar" {with-test} 22 23 "odoc" {with-doc} 23 24 ]
+4
dune
··· 1 1 (env 2 2 (dev 3 3 (flags :standard %{dune-warnings}))) 4 + 5 + (mdx 6 + (files README.md) 7 + (libraries block eio eio.core eio_main))
+2
dune-project
··· 1 1 (lang dune 3.21) 2 + (using mdx 0.4) 2 3 3 4 (name block) 4 5 ··· 25 26 (fmt (>= 0.9)) 26 27 (alcotest :with-test) 27 28 (eio_main :with-test) 29 + (mdx :with-test) 28 30 (alcobar :with-test)))