mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 05:39:18 +02:00
Adding file->string and file->bytevector.
This commit is contained in:
parent
3f588a558f
commit
8d13dad49b
2 changed files with 7 additions and 0 deletions
|
@ -4,6 +4,7 @@
|
|||
port-fold port-fold-right port-map
|
||||
port->list port->string-list port->sexp-list
|
||||
port->string port->bytevector
|
||||
file->string file->bytevector
|
||||
file-position set-file-position! seek/set seek/cur seek/end
|
||||
make-custom-input-port make-custom-output-port
|
||||
make-custom-binary-input-port make-custom-binary-output-port
|
||||
|
|
|
@ -240,6 +240,12 @@
|
|||
((eof-object? c) (get-output-bytevector out))
|
||||
(write-u8 c out))))
|
||||
|
||||
(define (file->string path)
|
||||
(call-with-input-file path port->string))
|
||||
|
||||
(define (file->bytevector path)
|
||||
(call-with-input-file path port->bytevector))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; custom port utilities
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue