(* cat.ml - Don Yang (uguu.org) Copy file or stdin to stdout. 09/03/04 *) let rec cat infile = let eof = try (output_byte stdout (input_byte infile); 0) with End_of_file -> 1 in if eof != 0 then () else cat infile;; let infile = ( if Array.length Sys.argv > 1 then open_in_bin Sys.argv.(1) else stdin ) in (cat infile; close_in infile);;