# Get path of system image from within Julia?

**URL:** <https://discourse.julialang.org/t/get-path-of-system-image-from-within-julia/108257>\
**Category:** General Usage\
**Tags:** package-compiler, system-image\
**Created:** [January 2, 2024, 10:27am UTC](https://discourse.julialang.org/t/get-path-of-system-image-from-within-julia/108257 "2024-01-02T10:27:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnomotani](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnomotani/32/26753_2.png) [@johnomotani](https://discourse.julialang.org/u/johnomotani)\
**Post date:** [January 2, 2024, 10:27am UTC](https://discourse.julialang.org/t/get-path-of-system-image-from-within-julia/108257/1 "2024-01-02T10:27:58Z")

</div>

If I create a custom system image using `PackageCompiler`, and then start julia using that image like

```julia
$ julia -Jcustom_sysimage.so

```

is there a way to get the path to `custom_sysimage.so` from within julia?

The reason I ask is that I’d like to check that the image is newer than my source code in order to be able to warn the user when they might want to re-build the system image.

---

<div class="post-metadata">

**Author:** ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Post date:** [January 2, 2024, 2:57pm UTC](https://discourse.julialang.org/t/get-path-of-system-image-from-within-julia/108257/2 "2024-01-02T14:57:17Z")

</div>

There must be a better way, but here is a lead.

```julia
unsafe_string(Base.JLOptions().image_file)

```

---

<div class="post-metadata">

**Author:** ![johnomotani](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnomotani/32/26753_2.png) [@johnomotani](https://discourse.julialang.org/u/johnomotani)\
**Post date:** [January 3, 2024, 1:29pm UTC](https://discourse.julialang.org/t/get-path-of-system-image-from-within-julia/108257/3 "2024-01-03T13:29:09Z")

</div>

Thanks @mkitti, that does work for what I wanted!
