When we copy the path of a file, it is also true in atom, and often the path is not an absolute path that can be directly processed, and often feels inconvenient. This article Thanks @ Sand silver.
julia> Path = "D:\strategyJulia\testfun.jl"
"D:STRATEGYJULIA\TESTFUN.JL"
julia> Open (path)
ERROR : systemerror:opening file D:strategyjulia estfun.jl:Invalid argument in
#systemerror #51 at. \error.jl:34 [ Inlined] in
systemerror (:: A string,:: BOOL) at. \error.jl:34 in open (::.:: BOOL,:, BOOL,:: BOOL,::
bool,::; Bool) at. \iostream.jl:89 in
open (:: String) at. \iostream.jl:98
julia> abspath (path)
ERROR: Argumenterror:drive mismatch:c:\users\hong\appdata\local\julia-0.5.0 d:strategyjulia estfun.jl
in Joinpath (:: String,:: String) at. \path.jl:82 on
abspath (:: String) at. \path.jl:125
julia> ispath (path)
false
To do so, you must convert the path to a read-only route.
julia> path2 = "D:\\strategyjulia\\testfun.jl"
"D:\\STRATEGYJULIA\\TESTFUN.JL"
julia> Open (path2)
IOStream (<file d:\strategyjulia\testfun.jl>)
The problem is that this artificial conversion is extremely inconvenient, Julia has a convenient way of conversion. Try it, Abspath,realpath not seem to be all right.
Method: Add S, hint, only small s useful, big S is not good.
Path = "D:\strategyJulia\testfun.jl"
path2= S "D:\strategyJulia\testfun.jl"
path3 = "d:\\strategyjulia\\ Testfun.jl "
Path2==path3 # True