mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-08 13:37:35 +02:00
Supporting tar on bytevectors.
This commit is contained in:
parent
298e47e932
commit
71aeb419fb
1 changed files with 4 additions and 2 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue