From: John Benediktsson Date: Wed, 1 Aug 2018 21:25:25 +0000 (-0700) Subject: tools.cat: use re-encode/re-decode. X-Git-Tag: 0.99~4059 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=ed9df3303dacca89e7fc842e054c1a1b24c72fce tools.cat: use re-encode/re-decode. --- diff --git a/extra/tools/cat/cat.factor b/extra/tools/cat/cat.factor index 0798d757e0..45694598df 100644 --- a/extra/tools/cat/cat.factor +++ b/extra/tools/cat/cat.factor @@ -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 -- )