blob: 8a45aa8a32708672f972075b2665a497d18cea91 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
############################################################################
#
# File: pack.icn
#
# Subject: Program to package multiple files
#
# Author: Ralph E. Griswold
#
# Date: July 1, 1997
#
############################################################################
#
# This file is in the public domain.
#
############################################################################
#
# This programs takes a list of file names on the command line 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(args)
local in, name
every name := !args do {
close(\in)
in := open(name) | stop("cannot open input file: ",name)
write("##########")
write(name)
while write(read(in))
}
end
|