Julia: joinpath() doesn't add path separator between drive and directory

Created on 1 Feb 2017  Â·  4Comments  Â·  Source: JuliaLang/julia

On Windows, Julia v0.5.0

julia> joinpath("C:", "Temp")
"C:Temp"
doc windows

Most helpful comment

So what's the correct way of doing this? We should add an example to the docstring for Windows.

All 4 comments

That's the correct path. It's a relative path from C: to Temp via the current working directory of C: (which may be accessible as ENV["=C"])

So what's the correct way of doing this? We should add an example to the docstring for Windows.

There's a note explaining what

joinpath("C:", "Temp")

actually represents in the docstring for joinpath

So what's the correct way of doing this?

Turning two relative paths into an absolute path just isn't something joinpath does. This is like asking why joinpath("foo", "bar") doesn't produce the absolute path /foo/bar and since it doesn't, how does one get joinpath to produce an absolute path. The answer is: you don't, you get an absolute some other way.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

omus picture omus  Â·  3Comments

StefanKarpinski picture StefanKarpinski  Â·  3Comments

TotalVerb picture TotalVerb  Â·  3Comments

Keno picture Keno  Â·  3Comments

arshpreetsingh picture arshpreetsingh  Â·  3Comments