home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / historic / v941.tgz / icon.v941src.tar / icon.v941src / ipl / progs / filerepl.icn < prev    next >
Text File  |  2000-07-29  |  853b  |  36 lines

  1. ############################################################################
  2. #
  3. #    File:     filerepl.icn
  4. #
  5. #    Subject:  Program to replicate file
  6. #
  7. #    Author:   Ralph E. Griswold
  8. #
  9. #    Date:     January 2, 1999
  10. #
  11. ############################################################################
  12. #
  13. #  This file is in the public domain.
  14. #
  15. ############################################################################
  16. #
  17. #  This program writes standard input to standard a specified number of
  18. #  times.  Number of replications is given on command line.
  19. #
  20. #  NOTE:  Since the input stream is stored internally, standard input
  21. #  must be of finite length.
  22. #
  23. ############################################################################
  24.  
  25. procedure main(args)
  26.    local file
  27.  
  28.    file := []
  29.  
  30.    while put(file, read())
  31.  
  32.    every 1 to args[1] do
  33.       every write(!file)
  34.  
  35. end
  36.