From 45e5425d8a3e15424bb31de198fedcfd49a668ab Mon Sep 17 00:00:00 2001 From: Fons van der Plas Date: Tue, 16 May 2023 17:33:02 +0200 Subject: [PATCH] Docs: simple docstring for `read(filename::AbstractString)` --- base/io.jl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/base/io.jl b/base/io.jl index 9c00c57576bac..4163a5e803676 100644 --- a/base/io.jl +++ b/base/io.jl @@ -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)