summaryrefslogtreecommitdiff
path: root/gr-run-waveform/guile/cat.scm
diff options
context:
space:
mode:
authorNick Foster2011-01-10 15:25:19 -0800
committerNick Foster2011-01-10 15:25:19 -0800
commit70e978b7fdc0285b56ed3ec7be3f10dc3d922504 (patch)
tree75231113034c1ac75277fbe444c02e9b600b2a7a /gr-run-waveform/guile/cat.scm
parent0e92b93f21fc9c324c379bc318120d414e7422cc (diff)
parentbb438e7d12c5767123f8abed5810f284a5f18bf8 (diff)
downloadgnuradio-70e978b7fdc0285b56ed3ec7be3f10dc3d922504.tar.gz
gnuradio-70e978b7fdc0285b56ed3ec7be3f10dc3d922504.tar.bz2
gnuradio-70e978b7fdc0285b56ed3ec7be3f10dc3d922504.zip
Merge branch 'next' of http://gnuradio.org/git/gnuradio into next
Diffstat (limited to 'gr-run-waveform/guile/cat.scm')
-rw-r--r--gr-run-waveform/guile/cat.scm15
1 files changed, 15 insertions, 0 deletions
diff --git a/gr-run-waveform/guile/cat.scm b/gr-run-waveform/guile/cat.scm
new file mode 100644
index 000000000..6a5a38acf
--- /dev/null
+++ b/gr-run-waveform/guile/cat.scm
@@ -0,0 +1,15 @@
+;;; This is non-idiomatic, but will exercise the port...
+(define (cat input-port)
+ (let loop ((ch (read-char input-port)))
+ (if (not (eof-object? ch))
+ (begin
+ (write-char ch (current-output-port))
+ (loop (read-char input-port))))))
+
+(define foo (make-gnuradio-port "ice-9/boot-9.scm"))
+;;(define foo (cat (make-gnuradio-port "ice-9/boot-9.scm")))
+
+;; # Then start guile and use it
+;; guile> (load "/tmp/cat.scm")
+;; guile> (cat (open-file "/etc/passwd" "r"))
+