-- lwa_cat.adb -- -- This simple test program does the equivalent of a cat or type command. -- It opens an input file stream for each filename on the command-line, -- reads the file and outputs it to the STDOUT file stream. -- -- Created in 1997 by Roy T. Fielding -- with Ada.Command_Line; with Onions.Buckets; with Onions.Instreams.File; use Onions.Instreams; use Onions.Instreams.File; with Onions.Outstreams.File; use Onions.Outstreams; use Onions.Outstreams.File; procedure Lwa_Cat is Spin : Input_Pipe; Spout : Output_Pipe; Blist : Onions.Buckets.Bucket_List; begin for I in 1 .. Ada.Command_Line.Argument_Count loop Spin := Open (new File_Input_Stream, Ada.Command_Line.Argument (I)); Spout := Open (new File_Output_Stream); loop begin Read (Spin, Blist); Write (Spout, Blist); exception when Onions.Instreams.End_Error => Flush (Spout); exit; end; end loop; Close (Spin); Close (Spout); end loop; end Lwa_Cat;