diff --git a/base/client.jl b/base/client.jl index ffa4eec0c4bd7..375e41d3ee38f 100644 --- a/base/client.jl +++ b/base/client.jl @@ -472,6 +472,8 @@ Returns the result of the last evaluated expression of the input file. During in a task-local include path is set to the directory containing the file. Nested calls to `include` will search relative to that path. This function is typically used to load source interactively, or to combine files in packages that are broken into multiple source files. +The argument `path` is normalized using [`normpath`](@ref) which will resolve +relative path tokens such as `..` and convert `/` to the appropriate path separator. The optional first argument `mapexpr` can be used to transform the included code before it is evaluated: for each parsed expression `expr` in `path`, the `include` function diff --git a/base/path.jl b/base/path.jl index 253bd81684d2f..454fe5bd65d32 100644 --- a/base/path.jl +++ b/base/path.jl @@ -356,12 +356,16 @@ joinpath """ normpath(path::AbstractString) -> String -Normalize a path, removing "." and ".." entries. +Normalize a path, removing "." and ".." entries and changing "/" to the canonical path separator +for the system. # Examples ```jldoctest julia> normpath("/home/myuser/../example.jl") "/home/example.jl" + +julia> normpath("Documents/Julia") == joinpath("Documents", "Julia") +true ``` """ function normpath(path::String)