file/zip: recognize string ports as seekable
This commit is contained in:
parent
64bfb58dad
commit
da600ad291
|
@ -72,10 +72,11 @@
|
||||||
|
|
||||||
;; seekable-port? : port -> boolean
|
;; seekable-port? : port -> boolean
|
||||||
(define (seekable-port? port)
|
(define (seekable-port? port)
|
||||||
(and (file-stream-port? port)
|
(or (string-port? port)
|
||||||
(with-handlers ([void (lambda (exn) #f)])
|
(and (file-stream-port? port)
|
||||||
(file-position port (file-position port))
|
(with-handlers ([void (lambda (exn) #f)])
|
||||||
#t)))
|
(file-position port (file-position port))
|
||||||
|
#t))))
|
||||||
|
|
||||||
(define (write-int n size)
|
(define (write-int n size)
|
||||||
(write-bytes (integer->integer-bytes n size #f #f)))
|
(write-bytes (integer->integer-bytes n size #f #f)))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user