Arc Forumnew | comments | leaders | submitlogin
2 points by rocketnia 2691 days ago | link | parent

I found some cool stuff at (http://docs.racket-lang.org/reference/port-lib.html#(def._((...).

This might work:

  (w/outfile o f
    (let i ($.make-limited-input-port req!in n)
      (after ($.copy-port i o)
        close.i)))
For all I know, closing i may not be necessary:

  (w/outfile o f
    ($.copy-port ($.make-limited-input-port req!in n) o))
Note that this copies n bytes. The code you posted deals with n characters for some reason, even though Arc provides 'readb and 'writeb for dealing with bytes.


1 point by lark 2690 days ago | link

Thanks for the help. I tried with readb instead of readc and received a browser error with the 874996-byte file.

-----