home *** CD-ROM | disk | FTP | other *** search
- ############################################################################
- #
- # File: pack.icn
- #
- # Subject: Program to package multiple files
- #
- # Author: Ralph E. Griswold
- #
- # Date: May 27, 1989
- #
- ###########################################################################
- #
- # This programs reads a list of file names from standard input and
- # packages the files into a single file, which is written to standard
- # output.
- #
- # Files are separated by a header, ##########, followed by the file
- # name. This simple scheme does not work if a file contains such a header
- # itself, and it's problematical for files of binary data.
- #
- ############################################################################
- #
- # See also: unpack.icn
- #
- ############################################################################
-
- procedure main()
- local in
-
- while name := read() do {
- close(\in)
- in := open(name) | stop("cannot open input file: ",name)
- write("##########")
- write(name)
- while write(read(in))
- }
- end
-