chibi-scheme/lib/chibi/snow/utils.scm
2015-04-21 00:01:46 +09:00

10 lines
332 B
Scheme

;;> Copies the file \var{from} to \var{to}.
(define (copy-file from to)
(let ((in (open-binary-input-file from))
(out (open-binary-output-file to)))
(let lp ()
(let ((n (read-u8 in)))
(cond ((eof-object? n) (close-input-port in) (close-output-port out))
(else (write-u8 n out) (lp)))))))