import std/[streams, memfiles] # name of the current nim file var stream = newMemMapFileStream("tast3.nim", fmRead) var data = newSeq[byte](10) doAssert stream.readData(addr data[0], 10) == 10 echo data