Skip to content

Latest commit

 

History

History
23 lines (18 loc) · 269 Bytes

README.md

File metadata and controls

23 lines (18 loc) · 269 Bytes

Memory Map a File (MMAP)

echo hello > /tmp/mmap-test 
at, err := mmap.Open("/tmp/mmap-test")

if err != nil {
    log.Fatal(err)
}

buff := make([]byte, 5)
_, _ = at.ReadAt(buff, 0)
_ = at.Close()
fmt.Println(string(buff))

output:

hello