/* * taput -- A 9-track tape/image conversion utility. * * Copyright (c) 2006, Scott G. Taylor * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * SCOTT G. TAYLOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of Scott G. Taylor shall not * be used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Scott G. Taylor. */ TAPE UTILITY (taput) USAGE: taput [-aoAOsvd] [-o outfilespec] [-b blksize] [infilespec ...] Command line flags: -o ofile Output file; default is stdout. -a Auto-detect input-file formats. Only CPTP and TAP formats. -B Max blocksize; some mag tape devices have maximum blocksizes that can be read. -v Be verbose. -d Enable debugging output; display each read block's recno and length. -O Overwrite existing output file. -A Append to existing output file. -s Scan only; check validity of input files. File definition for infilespec and outfilespec: /dev/mt0[:blocksize] Read mag tape device. blocksize indicates max blocksize to read, as some devices have a limit. file:b[:blocksize] disk file, blocked to a specific size. file:d Input-file list described in a text file. (Not Yet Implemented). file.cptp:c CPTP-format file. file.tap:t TAP/SIMH-format file. file.tpc:p TPC-format file. 512:s STDIN, blocked to a specific size (Not Yet Implemented). :s- Read file list from STDIN. (Not Yet Implemented) blocksize :: 0..[machine-specific-maximum] Machine-specific maximum block sizes: FreeBSD and OS X: 131072 Linux: 131072 SunOS: 131072 CRAY: 2048000 NetBSD: 131072 OpenBSD 131072 IRIX: 2048000 All others: 32768 Formats: CPTP CPTP:XXX record headers TAP 32b -- DATA (even block sizes) -- 32b E11 32b -- DATA -- 32b TPC 16b -- DATA RAW DATA (specify block size) MAGTAPE DATA (physical blocksize read) Auto-identification (in order of detection precedence): Real Mag Tape device, via ioctl(MTIOCGET) CPTP tape image TAP/SIMH tape image TPC tape image Fallback to RAW (blocked) Examples: Write the binary files "stand" and "miniroot" in 512-byte blocks, and the binary files "rootdump" and "usr.tar" in 10240-byte blocks, and write them as a SIMH/TAP- format file named "43test.tap". $ taput -vo 43test.tap:t stand:b:512 miniroot:b:512 rootdump:b:10240 usr.tar:b:10240 Convert the 43test.tap file, automatically detected as a SIMH/TAP-format image, into a CPTP-format image: $ taput -avo 43test.cptp:c 43test.tap Scan (read only) all files listed, and report their auto-detection, validity and read through them to test integrity: $ mod98# taput -asv *.cptp *.tap *.tpc Input data from CPTP-format Tape Image, block size 131072, file name "43dist.cptp". Input data from CPTP-format Tape Image, block size 131072, file name "miniroot.cptp". Input data from CPTP-format Tape Image, block size 131072, file name "rootdump.cptp". Input data from CPTP-format Tape Image, block size 131072, file name "stand.512.cptp". Input data from CPTP-format Tape Image, block size 131072, file name "tape1.cptp". Input data from CPTP-format Tape Image, block size 131072, file name "test.cptp". Input data from CPTP-format Tape Image, block size 131072, file name "test2.cptp". Input data from CPTP-format Tape Image, block size 131072, file name "usr.tar.cptp". Input data from TAP/SIMH-Format Tape Image, block size 131072, file name "43dist.tap". Input data from TAP/SIMH-Format Tape Image, block size 131072, file name "43test.tap". Input data from TAP/SIMH-Format Tape Image, block size 131072, file name "43test2.tap". Input data from TAP/SIMH-Format Tape Image, block size 131072, file name "tape1.tap". Input data from TAP/SIMH-Format Tape Image, block size 131072, file name "test.tap". Input data from TAP/SIMH-Format Tape Image, block size 131072, file name "usr.tar.tap". Input data from Fixed-block File, block size 131072, file name "xx.tpc". Scanning input data only--no output written. Opening input file: 43dist.cptp Opening input file: miniroot.cptp Opening input file: rootdump.cptp Opening input file: stand.512.cptp Opening input file: tape1.cptp Opening input file: test.cptp Opening input file: test2.cptp Opening input file: usr.tar.cptp Opening input file: 43dist.tap Opening input file: 43test.tap Opening input file: 43test2.tap Opening input file: tape1.tap Opening input file: test.tap Opening input file: usr.tar.tap Opening input file: xx.tpc NOTE: TPC-format images cannot (yet) be automatically detected. Positively identifying this image type is difficult, as the image format does not contain trailing record lengths in the format. TESTED CONVERSIONS: REAL MAG TAPE -> CPTP CPTP -> REAL MAG TAPE CPTP -> SIMH/TAP SIMH/TAP -> CPTP TPC -> CPTP CPTP -> TPC SIMH/TAP -> TPC TPC -> SIMH/TAP BLOCK FILE -> CPTP CPTP -> BLOCK FILE BLOCK FILE -> SIMH/TAP SIMH/TAP -> BLOCK FILE BLOCK FILE -> TPC TPC -> BLOCK FILE FUTURE FORMATS: Hercules AWS format