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


#1

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)


#2

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


#3

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


#4

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.