Skip to content

Commit

Permalink
doc: simple docstring for read(filename::AbstractString) (#49836)
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp authored May 30, 2023
1 parent 318f0ea commit d912d85
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions base/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -461,14 +461,18 @@ wait_close(io::AbstractPipe) = (wait_close(pipe_writer(io)::IO); wait_close(pipe
write(filename::AbstractString, a1, args...) = open(io->write(io, a1, args...), convert(String, filename)::String, "w")

"""
read(filename::AbstractString, args...)
read(filename::AbstractString)
Open a file and read its contents. `args` is passed to `read`: this is equivalent to
`open(io->read(io, args...), filename)`.
Read the entire contents of a file as a `Vector{UInt8}`.
read(filename::AbstractString, String)
Read the entire contents of a file as a string.
read(filename::AbstractString, args...)
Open a file and read its contents. `args` is passed to `read`: this is equivalent to
`open(io->read(io, args...), filename)`.
"""
read(filename::AbstractString, args...) = open(io->read(io, args...), convert(String, filename)::String)

Expand Down

0 comments on commit d912d85

Please sign in to comment.