4thSpace
4thSpace

Reputation: 44312

What should path be to Julia source file?

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?

Upvotes: 0

Views: 377

Answers (1)

laborhm
laborhm

Reputation: 139

Isomorphic to OS:

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

include("your_julia_file.jl")

Upvotes: 2

Related Questions