[gambit-list] creating scheme ports from filehandles

Christian christian at pflanze.mine.nu
Mon Jul 24 18:34:00 EDT 2006


Is there a way to turn a POSIX filehandle into a Gambit scheme port,
or could it be added?

I'm imaging something like:
  (posix-fd->port 0) => returning an input-output port
  (open-port (list posix-fd: 0 direction: 'input)) ;; in case one wants
                               ;; the direction to be preserved.
or similar.

This would allow things like implement functions creating unix
sockets, or maybe even UDP ports; well for the latter maybe more
changes would actually be needed. Maybe I should ask (instead of the
above) how one can, from a C function, read/write from/to a file
descriptor without blocking the system (using the scheduler, thus
possibly running other scheme code in the mean time).


More information about the Gambit-list mailing list