# Is it possible to mmap part of the file?

**URL:** https://discourse.julialang.org/t/is-it-possible-to-mmap-part-of-the-file/40391
**Category:** General Usage
**Tags:** mmap
**Created:** [May 29, 2020, 3:06am UTC](https://discourse.julialang.org/t/is-it-possible-to-mmap-part-of-the-file/40391 "2020-05-29T03:06:27Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)
#### Post date: [May 29, 2020, 3:06am UTC](https://discourse.julialang.org/t/is-it-possible-to-mmap-part-of-the-file/40391/1 "2020-05-29T03:06:27Z")

</div>

I see the doc here has example of how to mmap the whole file [Memory-mapped I/O · The Julia Language](https://docs.julialang.org/en/v1/stdlib/Mmap/)

But say if I want to mmap bytes `n` to `m` of a file to an array, is that possible?

Do I have to use `unsafe_wrap`?

---

<div class="post-metadata">

### Author: ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)
#### Post date: [May 29, 2020, 3:36am UTC](https://discourse.julialang.org/t/is-it-possible-to-mmap-part-of-the-file/40391/2 "2020-05-29T03:36:25Z")

</div>

> Optionally, you can specify an offset (in bytes) if, for example, you want to skip over a header in the file. The default value for the offset is the current stream position for an `IOStream` .
