diff --git a/base/path.jl b/base/path.jl index 93ee39910f148..6fd85827d37c2 100644 --- a/base/path.jl +++ b/base/path.jl @@ -415,6 +415,16 @@ normpath(a::AbstractString, b::AbstractString...) = normpath(joinpath(a,b...)) Convert a path to an absolute path by adding the current directory if necessary. Also normalizes the path as in [`normpath`](@ref). + +# Example + +If you are in a directory called `JuliaExample` and the data you are using is two levels up relative to the `JuliaExample` directory, you could write: + +abspath("../../data") + +Which gives a path like `"/home/JuliaUser/data/"`. + +See also [`joinpath`](@ref), [`pwd`](@ref), [`expanduser`](@ref). """ function abspath(a::String)::String if !isabspath(a)