This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Input/output problems with closed ports



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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]