[plt-scheme] converting file descriptor from C FFI to Scheme port

From: Ryan Culpepper (ryanc at ccs.neu.edu)
Date: Sat Dec 5 11:22:54 EST 2009

Neil Van Dyke wrote:
> When using the FFI, how to I turn a file descriptor produced by a C 
> function into a Scheme input port (like "scheme_make_fd_input_port", but 
> from Scheme rather than C)?

Use the FFI to get "scheme_make_fd_input_port" and call it. Similar code 
is here (search for the use and definition of _make_fd_output_port):

http://planet.plt-scheme.org/package-source/schematics/spgsql.plt/2/3/private/socket.ss

Ryan


Posted on the users mailing list.