From e54ad05bb0979d2b3a936875a5b55aa5587cb051 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sat, 3 Jan 2009 12:20:48 +0000 Subject: [PATCH] doc read/write closed ports => exn:fail svn: r12984 --- collects/scribblings/reference/ports.scrbl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/collects/scribblings/reference/ports.scrbl b/collects/scribblings/reference/ports.scrbl index 2073b58320..fcf8803761 100644 --- a/collects/scribblings/reference/ports.scrbl +++ b/collects/scribblings/reference/ports.scrbl @@ -7,6 +7,13 @@ a character-based operation, the port's bytes are decoded; see @secref["encodings"]. +When a port corresponds to a file, network connection, or some other +system resource, is must be explicitly closed via +@scheme[close-input-port] or @scheme[close-output-port] (or indirectly +via @scheme[custodian-shutdown-all]) to release low-level resources +associated with the port. For any kind of port, after it is closed, +attempting to read from or write to the port raises @scheme[exn:fail]. + The global variable @scheme[eof] is bound to the end-of-file value, and @scheme[eof-object?] returns @scheme[#t] only when applied to this value. Reading from a port produces an end-of-file result when the