tools.cat: use re-encode/re-decode.

handle-patch-and-put
John Benediktsson 2018-08-01 14:25:25 -07:00
parent 5e9b804d66
commit ed9df3303d
1 changed files with 3 additions and 3 deletions

View File

@ -1,14 +1,14 @@
! Copyright (C) 2010 John Benediktsson ! Copyright (C) 2010 John Benediktsson
! See http://factorcode.org/license.txt for BSD license ! 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 ; io.encodings.binary io.files kernel namespaces sequences ;
IN: tools.cat IN: tools.cat
: cat-stream ( -- ) : cat-stream ( -- )
input-stream get dup decoder? [ stream>> ] when input-stream get binary re-decode
output-stream get dup encoder? [ stream>> ] when output-stream get binary re-encode
'[ _ stream-write ] each-stream-block ; '[ _ stream-write ] each-stream-block ;
: cat-file ( path -- ) : cat-file ( path -- )