# Include command inconsistent with isfile result

**URL:** <https://discourse.julialang.org/t/include-command-inconsistent-with-isfile-result/26578>\
**Category:** General Usage\
**Created:** [July 20, 2019, 10:51am UTC](https://discourse.julialang.org/t/include-command-inconsistent-with-isfile-result/26578 "2019-07-20T10:51:33Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [July 21, 2019, 1:04pm UTC](https://discourse.julialang.org/t/include-command-inconsistent-with-isfile-result/26578/15 "2019-07-21T13:04:54Z")

</div>

I think you missed the fact that `include` operates relative to `@ __DIR__ `, which has nothing to do with the “current directory”, which is essentially a global state. Cf

```nohighlight
$ pwd
/home/tamas

$ cat /tmp/test.jl 
@info "working directory" pwd()
@info "directory of file" @ __DIR__

$ julia /tmp/test.jl
┌ Info: working directory
└ pwd() = "/home/tamas"
┌ Info: directory of file
└ #= /tmp/test.jl:2 =# @ __DIR__ = "/tmp"

```

As explained by @pixel27, conflating the two would have obvious disadvantages — global state should be avoided unless absolutely necessary.

---

_[View the full topic](https://discourse.julialang.org/t/include-command-inconsistent-with-isfile-result/26578)._
