From c1d21e11a276ebf71b677076a064b5144c2e8f46 Mon Sep 17 00:00:00 2001 From: Katharine Hyatt Date: Wed, 13 Jul 2022 03:32:28 -0400 Subject: [PATCH] Doctest example for eof (#46012) --- base/io.jl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/base/io.jl b/base/io.jl index ca96075a1b11e..59bce5eb4de6d 100644 --- a/base/io.jl +++ b/base/io.jl @@ -173,6 +173,19 @@ function will block to wait for more data if necessary, and then return `false`. it is always safe to read one byte after seeing `eof` return `false`. `eof` will return `false` as long as buffered data is still available, even if the remote end of a connection is closed. + +# Examples +```jldoctest +julia> b = IOBuffer("my buffer"); + +julia> eof(b) +false + +julia> seekend(b); + +julia> eof(b) +true +``` """ function eof end