aboutsummaryrefslogtreecommitdiff
path: root/scheme/idest/batch/setpic.scm
diff options
context:
space:
mode:
Diffstat (limited to 'scheme/idest/batch/setpic.scm')
-rw-r--r--scheme/idest/batch/setpic.scm24
1 files changed, 12 insertions, 12 deletions
diff --git a/scheme/idest/batch/setpic.scm b/scheme/idest/batch/setpic.scm
index c0670a3..834a571 100644
--- a/scheme/idest/batch/setpic.scm
+++ b/scheme/idest/batch/setpic.scm
@@ -1,3 +1,3 @@
;; This file is part of Idest
-;; Copyright (C) 2011 Sergey Poznyakoff
+;; Copyright (C) 2011, 2015 Sergey Poznyakoff
;;
@@ -18,3 +18,4 @@
-(use-modules (ice-9 getopt-long))
+(use-modules (ice-9 getopt-long)
+ (rnrs io ports))
@@ -28,13 +29,12 @@
(lambda ()
- (with-input-from-file
- file
- (lambda ()
- (let loop ((chr (read-char)))
+ (let ((port (open-file-input-port file)))
+ (let ((get-byte (lambda () (get-u8 port))))
+ (let loop ((n (get-byte)))
(cond
- ((not (eof-object? chr))
- (let ((n (char->integer chr)))
- (if (< n 16)
- (display "0"))
- (display (number->string n 16)))
- (loop (read-char))))))))))
+ ((not (eof-object? n))
+ (if (< n 16)
+ (display "0"))
+ (display (number->string n 16))
+ (loop (get-byte))))))
+ (close-port port)))))

Return to:

Send suggestions and report system problems to the System administrator.