# PackageCompiler.jl \`create\_app\` use path of the binary

**URL:** https://discourse.julialang.org/t/packagecompiler-jl-create-app-use-path-of-the-binary/45348
**Category:** General Usage
**Created:** [August 22, 2020, 3:30am UTC](https://discourse.julialang.org/t/packagecompiler-jl-create-app-use-path-of-the-binary/45348 "2020-08-22T03:30:24Z")
**Posts on this page:** 4
**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: [August 22, 2020, 3:30am UTC](https://discourse.julialang.org/t/packagecompiler-jl-create-app-use-path-of-the-binary/45348/1 "2020-08-22T03:30:25Z")

</div>

I made an app using `PackageCompiler.create_app` and it works really nice.

My app requires a database which is a file, and I would like to use the file in the same folder as the binary…

However when I run

```julia
~/bin/MyApp

```

The `pwd()` becomes the path from which I called `MyApp`. Is there a way for the app to know where the `bin` folder is?

---

<div class="post-metadata">

### Author: ![hellemo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hellemo/32/324_2.png) [@hellemo](https://discourse.julialang.org/u/hellemo)
#### Post date: [August 22, 2020, 6:40am UTC](https://discourse.julialang.org/t/packagecompiler-jl-create-app-use-path-of-the-binary/45348/2 "2020-08-22T06:40:44Z")

</div>

Did you have a look at the [`@ __DIR__ `](https://docs.julialang.org/en/v1/base/file/#Base.@ __DIR__ ) macro? (Expand to a string with the absolute path to the directory of the file containing the macrocall.)

---

<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: [August 22, 2020, 6:44am UTC](https://discourse.julialang.org/t/packagecompiler-jl-create-app-use-path-of-the-binary/45348/3 "2020-08-22T06:44:47Z")

</div>

It prints it where the source code was, not where the resultant binary is.

---

<div class="post-metadata">

### Author: ![hellemo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hellemo/32/324_2.png) [@hellemo](https://discourse.julialang.org/u/hellemo)
#### Post date: [August 22, 2020, 6:47am UTC](https://discourse.julialang.org/t/packagecompiler-jl-create-app-use-path-of-the-binary/45348/4 "2020-08-22T06:47:09Z")

</div>

I see. Maybe just use a relative path, then?

EDIT: Sorry, too early, that’s where the pwd() issue comes in, I get it.
