# Unexpected behavior: include() and @\_\_DIR\_\_

**URL:** <https://discourse.julialang.org/t/unexpected-behavior-include-and-dir/55218>\
**Category:** General Usage\
**Created:** [February 13, 2021, 5:34pm UTC](https://discourse.julialang.org/t/unexpected-behavior-include-and-dir/55218 "2021-02-13T17:34:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JuergenD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juergend/32/18970_2.png) [@JuergenD](https://discourse.julialang.org/u/JuergenD)\
**Post date:** [February 13, 2021, 5:34pm UTC](https://discourse.julialang.org/t/unexpected-behavior-include-and-dir/55218/1 "2021-02-13T17:34:38Z")

</div>

I’m regularly using `@doc read(joinpath(dirname(@ __DIR__ ), "README.md"), String) MyModule` for the (sub)module documentation. Unfortunately @ **DIR** doesn’t behave like documented [`Base.@ __DIR__ `](https://docs.julialang.org/en/v1/base/file/#Base.@ __DIR__ ) — Macro

```julia
@ __DIR__ -> AbstractString

```

Expand to a string with the absolute path to the directory of the file containing the macrocall. Return the current working directory if run from a REPL or if evaluated by `julia -e <expr>` .

The doc states _directory of the file containing the macrocall_. But in case the file was included(), this is not true. It is the file that created the global context. Is that expected?

Since @ **DIR** doesn’t reliably provide the directory of the source file, is there some other means I can use?
