]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/tools/cat/cat.factor
io.files: using some of the new file-exists combinators
[factor.git] / extra / tools / cat / cat.factor
index 73d2b0fac1a935e4e5a6d4f92f44629d71f5259a..c04d6917440b85a68692d00fea74758378e1e10b 100644 (file)
@@ -12,9 +12,8 @@ IN: tools.cat
     '[ _ [ stream-write ] [ stream-flush ] bi ] each-stream-block ;
 
 : cat-file ( path -- )
-    dup file-exists? [
-        binary [ cat-stream ] with-file-reader
-    ] [ write ": not found" print flush ] if ;
+    [ binary [ cat-stream ] with-file-reader ]
+    [ write ": not found" print flush ] if-file-exists ;
 
 : cat-files ( paths -- )
     [ dup "-" = [ drop cat-stream ] [ cat-file ] if flush ] each ;