Supporting tar on bytevectors.

This commit is contained in:
Alex Shinn 2014-04-01 18:43:24 +09:00
parent 298e47e932
commit 71aeb419fb

View file

@ -73,10 +73,12 @@
;; fundamental iterator ;; fundamental iterator
(define (tar-fold src kons knil) (define (tar-fold src kons knil)
(let ((in (if (string? src) (open-binary-input-file src) src))) (let ((in (cond ((string? src) (open-binary-input-file src))
((bytevector? src) (open-input-bytevector src))
(else src))))
(let lp ((acc knil)) (let lp ((acc knil))
(cond (cond
((eof-object? (peek-char in)) ((eof-object? (peek-u8 in))
(close-input-port in) (close-input-port in)
acc) acc)
(else (else