0

I have a .jl file at /Users/myuser/Documents/JuliaLearn/Julia/mysource.jl

In Julia Repl, I'm trying to run as:

include("/Users/myuser/Documents/JuliaLearn/Julia/mysource.jl")

But get this error:

ERROR: could not open file /Users/myuser/~/Documents/JuliaLearn/Julia/mysource.jl in include at /Applications/Julia-0.4.5.app/Contents/Resources/julia/lib/julia/sys.dylib in include_from_node1 at /Applications/Julia-0.4.5.app/Contents/Resources/julia/lib/julia/sys.dylib

I also tried but get an error similar to the above:

include("~/Documents/JuliaLearn/Julia/mysource.jl")

Any idea what I'm doing wrong?

2

1 Answer 1

2

Isomorphic to OS:

cd(joinpath(homedir(),"a_long","path","to_your","files"));

include("your_julia_file.jl")
1
  • You have to change directory in order to include a file? Doesn't seem like a very solid solution.
    – trojanfoe
    May 23, 2016 at 7:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.