Something went wrong. Try again.
Something went wrong. Try again.
block_device README.md
BlockDevice #
BlockDevice provides a simple in-memory block device interface on top of an :ets table.
It can be used to simulate files or otherwise mock I/O.
Usage #
bd = BlockDevice.new(1024)
:ok = BlockDevice.write(bd, 3, "foo")
{:ok, data} = BlockDevice.read(bd, 0, 8)
dbg(data) # => "\x00\x00\x00foo\x00\x00"
:ok = BlockDevice.destroy(bd)