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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
|
.help reblock Mar84 dataio
.ih
NAME
reblock -- copy a file on tape or disk with optional reblocking
.ih
USAGE
reblock (infiles, outfiles, file_list)
.ih
PARAMETERS
.ls infiles
File or device name e.g. "mta1600[2]" or "mta800" or "file1".
.le
.ls outfiles
If multiple file to disk is requested, the ouput file names will be generated
by concatenating the tape file number onto the output file name.
.le
.ls file_list
List of tape file numbers or ranges delimited by whitespace or commas,
e.g. "1-3, 5_8".
File_list is requested only if the magtape input device is specified.
Files will be read in ascending order regardless of the ordering of the list.
Reading will terminate silently if EOT is reached, thus a list such as
"1-999" may be used to read all files on the tape.
.le
.ls newtape
If the output device is magtape, newtape specifies whether the tape is
blank or contains data.
Newtape is requested only if no tape file number is specified, e.g. "mta1600".
.le
.ls outblock = INDEF
Size of the output block bytes.
In the default case and for disk output, the output block size is set to the
file i/o disk default buffer size.
.le
.ls inrecord = INDEF, outrecord = INDEF
The sizes of the input and output logical records in bytes.
The default input and output record sizes are set equal to
the input and output block sizes respectively. If inrecord > outrecord,
records are trimmed; if inrecord < outrecord, records are padded; if
inrecord = outrecord, records are simply counted. If only one of inrecord or
outrecord is set, the undefined parameter defaults to the value of the
other.
.le
.ls nskip = 0
The number of input blocks (tape input) or records (disk input, size inrecord)
to be skipped.
.le
.ls ncopy = INDEF
The number of input blocks (tape input) or records
(disk input, size inrecord) to be copied. Ncopy defaults to a very large number.
.le
.ls byteswap = no
Swap every other byte.
.le
.ls wordswap = no
Swap every other word.
.le
.ls pad_block = no
If pad_block is set, reblock pads trailing blocks until they are outblock
bytes long, otherwise trailing blocks may be short.
.le
.ls padchar = 0
Single character used to pad blocks or records.
Padchar is only requested if pad_record or pad_block
is set. If padchar equals one of the digits 0 through nine, records and
blocks are padded with the face value of the character, otherwise the
ASCII value is used.
.le
.ls verbose = yes
Print messages about files, blocks copied etc.
.le
.ih
DESCRIPTION
REBLOCK is a procedure to copy disk or tape resident files to
disk or tape. Multiple tape files or a single disk input file may be specified.
If multiple files are output to disk the output file names will be
generated by concatenating the tape file number onto the output file name.
The user may request magnetic tape output to begin at a specific file on
tape, e.g. mta1600[5] in which case file five will be overwritten if it
exists, or at BOT or EOT. If no file number is specified REBLOCK asks
whether the tape is new or old and begin writing at BOT or EOT as
appropriate.
Before beginning the copy, the user may request reblock to skip
n (default 0) blocks (tape input) or logical records (disk input).
The user can also specify that
only n (default all) blocks (tape input) or records (disk input)
are to be copied. Before the copy the data may be optionally word-swapped
(default no) and/or byte-swapped (default no). If verbose is specified
(default yes) reblock prints the input and output file names,
the number of blocks read and written and the number of records read and
written.
Reblock
uses the default buffer sizes supplied by mtio and file i/o to determine the
maximum number of bytes which can be read in a single read call. For tapes
this corresponds to the maximum number of bytes per block permitted by the
device. Mtio will not read more than one block per read call. Therefore the
actual number of bytes read will be less than or equal to the mtio buffer size.
For disk files the default buffer size set by IRAF is a multiple of the
disk block size. If the disk file is smaller than one block
or the last block is partially full, the number of bytes read
will be less than the default buffer size. All magtape and disk reads are
done with the file i/o read procedure and a call to fstati determines the number
of bytes actually read.
If all the defaults are set, a binary copy is performed.
In tape to tape copies the block and record sizes are preserved,
but the density may
be changed by specifying the appropriate output file name e.g. mta800 or
mta1600.
Reblocking occurs in tape to disk transfers, if records, are trimmed,
padded or counted, or if blocks are padded.
If a disk to tape transfer is requested
the output block size will be the default file i/o buffer size.
The last block in a file may be short. If uniform sized blocks are
desired, pad_block must be set, in which case trailing partially filled
blocks will be padded with padchar.
Logical records are distinguished from blocks (physical records).
The input and output record sizes default to
the size of the input and output blocks respectively.
Logical records may be shorter or longer than the block sizes.
.ih
EXAMPLES
Copy a magnetic tape preserving the record sizes but changing
the density from 800 bpi to 1600 bpi.
.nf
da> reblock mtb800, "mta1600[1]", "1-999"
.fi
Reblock a magnetic tape changing the block size from 4000 bytes to 8000
bytes and padding the last block.
.nf
da> reblock mtb1600, "mta1600[1]", "1-999", outb=8000, padb+
.fi
Trim the records of a disk file.
.nf
da> reblock input, output, inrec=80, outrec=72
.fi
Pad the records of a disk file with blanks.
.nf
da> reblock input, output, inrec=81, outrec=82, padchar=" "
.fi
.endhelp
|