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 / pack.icn < prev    next >
Text File  |  2000-07-29  |  1KB  |  43 lines

  1. ############################################################################
  2. #
  3. #    File:     pack.icn
  4. #
  5. #    Subject:  Program to package multiple files
  6. #
  7. #    Author:   Ralph E. Griswold
  8. #
  9. #    Date:     July 1, 1997
  10. #
  11. ############################################################################
  12. #
  13. #   This file is in the public domain.
  14. #
  15. ############################################################################
  16. #
  17. #     This programs takes a list of file names on the command line and
  18. #  packages the files into a single file, which is written to standard
  19. #  output.
  20. #
  21. #     Files are separated by a header, ##########, followed by the file
  22. #  name.  This simple scheme does not work if a file contains such a header
  23. #  itself, and it's problematical for files of binary data.
  24. #
  25. ############################################################################
  26. #
  27. #  See also:  unpack.icn
  28. #
  29. ############################################################################
  30.  
  31. procedure main(args)
  32.    local in, name
  33.  
  34.    every name := !args do {
  35.       close(\in)
  36.       in := open(name) | stop("cannot open input file: ",name)
  37.       write("##########")
  38.       write(name)
  39.       while write(read(in))
  40.       }
  41.  
  42. end
  43.