]> gitweb.factorcode.org Git - factor.git/commitdiff
tools.cat: use re-encode/re-decode.
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 1 Aug 2018 21:25:25 +0000 (14:25 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 1 Aug 2018 21:25:25 +0000 (14:25 -0700)
extra/tools/cat/cat.factor

index 0798d757e03e68eaaf99eca2673455e8500cbe91..45694598df4736bf1804412da84081e85196d85d 100644 (file)
@@ -1,14 +1,14 @@
 ! Copyright (C) 2010 John Benediktsson
 ! See http://factorcode.org/license.txt for BSD license
 
-USING: accessors command-line formatting fry io io.encodings
+USING: command-line formatting fry io io.encodings
 io.encodings.binary io.files kernel namespaces sequences ;
 
 IN: tools.cat
 
 : cat-stream ( -- )
-    input-stream get dup decoder? [ stream>> ] when
-    output-stream get dup encoder? [ stream>> ] when
+    input-stream get binary re-decode
+    output-stream get binary re-encode
     '[ _ stream-write ] each-stream-block ;
 
 : cat-file ( path -- )