# Problem with "cd" and "include" (bug?)

**URL:** <https://discourse.julialang.org/t/problem-with-cd-and-include-bug/1870>\
**Category:** General Usage\
**Created:** [February 3, 2017, 3:19pm UTC](https://discourse.julialang.org/t/problem-with-cd-and-include-bug/1870 "2017-02-03T15:19:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lucabrugnolini](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lucabrugnolini/32/2039_2.png) [@lucabrugnolini](https://discourse.julialang.org/u/lucabrugnolini)\
**Post date:** [February 3, 2017, 3:19pm UTC](https://discourse.julialang.org/t/problem-with-cd-and-include-bug/1870/1 "2017-02-03T15:19:42Z")

</div>

Hello,

When I select the wd using `cd` and use `include` to load some functions, it happens that the pwd is not the one I’ve chosen using `cd`. More precisely, writing `pwd()` you get the directory you’ve chosen with `cd` but using `include` **if** you run the line from the editor you get an error (as you where in a different directory and the file is not found) **while if** you run the same line directly in the atom console you do not get any error and actually get the function loaded.

Hope it’s useful!

(julia 0.5.1, atom 1.11.2, ubuntu 16.04)

---

<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:** [February 3, 2017, 3:47pm UTC](https://discourse.julialang.org/t/problem-with-cd-and-include-bug/1870/2 "2017-02-03T15:47:43Z")

</div>

`include` always work relative to current script path (pwd for repl). You should also never use `cd` to account for include path.

---

<div class="post-metadata">

**Author:** ![lucabrugnolini](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lucabrugnolini/32/2039_2.png) [@lucabrugnolini](https://discourse.julialang.org/u/lucabrugnolini)\
**Post date:** [February 6, 2017, 10:44am UTC](https://discourse.julialang.org/t/problem-with-cd-and-include-bug/1870/3 "2017-02-06T10:44:19Z")

</div>

Thanks for the answer. However it seems strange to me that the same command works when I copy and paste it in the atom console and it doesn’t if I do _ctrl+enter_ in the atom editor.

Shouldn’t have the same current path these two objects?

Thanks

---

<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:** [February 6, 2017, 2:26pm UTC](https://discourse.julialang.org/t/problem-with-cd-and-include-bug/1870/4 "2017-02-06T14:26:14Z")

</div>

As I said, the REPL doesn’t have a current path so it can only use `pwd()` so no they don’t have the same current path.
