This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Input/output problems with closed ports
- To: guile at sourceware dot cygnus dot com
- Subject: Input/output problems with closed ports
- From: Bernard URBAN <Bernard dot Urban at meteo dot fr>
- Date: Tue, 30 Nov 1999 13:12:50 +0100
Hello!
How can you ensure it is legitimate to read from
or write to a port object ? Doing so on a closed port raises an
error with guile, which seems legitimate (though,
R5RS says so explicitely only for read, not read-char
and peek-char, and not for writing).
This situation can be handled with using
catch and throw. But this technique works only at the time you
perform the I/O, you cannot know the port status in advance.
The context where I encountered this problem was when dealing with sockets, to
test if the remote link is still there.
So I would actually have a "closed?" function, and it seems missing in
guile (have not looked elsewhere).
--
B. Urban