Section 3.2 now has a new argument type *port-type*, which is one of the symbols `binary-input`, `textual-input`, `binary-output`, `textual-output`, and `binary-input/output` (per SRFI 186).  There are now just 3 procedures:

open-file takes a required port-type argument and returns a port, so no fd exposure.  It also accepts an optional buffer-mode.

fd->port also takes a required port-type and optional buffer-mode.  It is an error to use this with a fd that is encapsulated in an existing port.  It is mostly meant for a fd that was open when the process started other than 0, 1, 2.

with-port-fd takes a port and a procedure.  It dups() the fd in the port,  passes the new fd to the proc, and closes the new fd when the proc returns.  It is an error to do something to the fd that messes up the port or that leaks the fd.  It is meant for doing things that aren't available in SRFI 170 and require a fd.

Finally, terminal? now takes a port only, as discussed earlier.

You can see the new editor's draft at <http://htmlpreview.github.io/?https://github.com/johnwcowan/srfi-170/blob/master/srfi-170.html>.  
I **hope** this is the last redesign of this section.  Comments?



John Cowan          http://vrici.lojban.org/~cowan        xxxxxx@ccil.org
You annoy me, Rattray!  You disgust me! You irritate me unspeakably!
Thank Heaven, I am a man of equable temper, or I should scarcely be able
to contain myself before your mocking visage.  --Stalky imitating Macrea