Skip to content

Commit

Permalink
Examples for path fxns? (#23362)
Browse files Browse the repository at this point in the history
  • Loading branch information
kshyatt authored and KristofferC committed Aug 20, 2017
1 parent 953bfc3 commit 1323561
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions base/path.jl
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ end
Determines whether a path is absolute (begins at the root directory).
# Examples
```jldoctest
julia> isabspath("/home")
true
Expand All @@ -103,6 +104,7 @@ isabspath(path::AbstractString)
Determines whether a path refers to a directory (for example, ends with a path separator).
# Examples
```jldoctest
julia> isdirpath("/home")
false
Expand All @@ -118,6 +120,7 @@ isdirpath(path::String) = ismatch(path_directory_re, splitdrive(path)[2])
Split a path into a tuple of the directory name and file name.
# Examples
```jldoctest
julia> splitdir("/home/myuser")
("/home", "myuser")
Expand All @@ -136,6 +139,7 @@ end
Get the directory part of a path.
# Examples
```jldoctest
julia> dirname("/home/myuser")
"/home"
Expand All @@ -150,6 +154,7 @@ See also: [`basename`](@ref)
Get the file name part of a path.
# Examples
```jldoctest
julia> basename("/home/myuser/example.jl")
"example.jl"
Expand All @@ -166,6 +171,7 @@ If the last component of a path contains a dot, split the path into everything b
dot and everything including and after the dot. Otherwise, return a tuple of the argument
unmodified and the empty string.
# Examples
```jldoctest
julia> splitext("/home/myuser/example.jl")
("/home/myuser/example", ".jl")
Expand Down Expand Up @@ -197,6 +203,7 @@ joinpath(a::AbstractString) = a
Join path components into a full path. If some argument is an absolute path, then prior
components are dropped.
# Examples
```jldoctest
julia> joinpath("/home/myuser","example.jl")
"/home/myuser/example.jl"
Expand All @@ -221,6 +228,7 @@ joinpath(a::AbstractString, b::AbstractString) = joinpath(String(a), String(b))
Normalize a path, removing "." and ".." entries.
# Examples
```jldoctest
julia> normpath("/home/myuser/../example.jl")
"/home/example.jl"
Expand Down

0 comments on commit 1323561

Please sign in to comment.