|
Links: { Chris Lowth's Home Page | LinWiz | TCP/IP Connection Cutter | Kazaa Blocking 'FTWall' | Protector } |
||
|
|
Current version : 1.07 (January 1997) [ In a perfect world, we will all do things the unix way ] My thanks are due to Michael A. Meiszl for help and ideas, in particular for work on the dynamic buffer sizing logic, German language help and error texts, and testing. Contents of this Page:OverviewTAPEIO is freeware. Click here for more details of the rules and restrictions governing it's use. This program provides access to the NT tape devices for unix-style archiving programs that take data from (or write to) their standard input and output devices. There are a number of shareware programs for NT (try shareware.com) that provide CPIO, TAR and other unix style backup formatting options. Sadly, NT does not provide unix-like access to tape devices through named directory entries (like "/dev/tape1", etc), so many of these programs cannot read or write tape backups. TAPEIO attempts to plug this hole. TAPEIO runs in two major modes..
There are a number of other options for selecting the device to use, the tape section to access, to elect to erase the tape at the start of a "write" operation or to eject the tape at the end. TAPEIO has been developed for NT4.0, and tested on the Olivetti SNX140 range of machines. It WILL NOT run on Win95 systems, but should (or so I reason) run on other hardware platforms that provide complient tape device drivers. If you find it does not work on your hardware, and you manage to resolve the problems by changing the code, please send me details of the changes (chris@lowth.com) so that I can include them in a future release - Thanks. Notes1: "Block sizes" (-b option)The block size argument (for the -w command) specifies the size of blocks that are written to tape. NT can handle a wide range of sizes (limited only by the capabilities of your tape drive hardware). Some other operating systems can only use a specific block size (typically 512 for unix 5.4, and 1024 for SCO unix). It is important that when creating tapes for exchange with other systems, you select an appropriate block size. The block size does NOT have to be a power of 2 in NT 4.0 and beyond. When reading tapes, tapeio determines the block size automatically, and can handle tapes created with block sizes upto (and including) 64 Kbytes. Unix systems are somewhat picky on the tapes they would like to read. The blocksize is a rather critical factor here. We can't tell you what size your Unix system likes to read, but we give you a tool to test it out. Create a tape on your Unix system, contents don't matter. Now enter the tape into your NT system and issue the command "tapeio -b?". You will get a report, indicating what size is used on the tape. Write down the value and use it as an argument for -b on future write commands. If you want the -b? result displayed in a particular format (for example, as a variable that the shell can collect), then use the -f option. The following batch script shows how this logic could be used.. tapeio -b? -f"SET N=~" > tmp.bat
call tmp.bat
del tmp.bat
echo Block size is %N% bytes
The '~' (tilde) character is used as the place-holder for the actual block size returned. 2: Preventing "Padding" (-n option)When specifying "block" sizes with the "-w" option (write), the data is copied to the tape in blocks of the specified size. If the file is not an exact multiple of this block size, the last block is filled with NULL characters to bring it up to size. The -n option prevents this "padding" logic, and causes the last block to be written with the actual size required to complete the file. When using tapeio with archive programs such as CPIO or TAR for interchange with unix systems, this flag should probably not be used, but if you are saving and restoring a "raw" data file that would be damaged by having nulls appended to it, then the option should be used. 3: "Section number" (-s and -a options)The '-s' option allows you to specify the tape "section" or "file set" to be accessed. Normally, the first section on tape is section number one, but some systems (eg: SCO) place an empty section at the start of the tape, so your data may be in section 2. When writing data to tape, the "end of tape" is flagged at the end of the most recently written section, so beware of thinking you can "update" a tape section - you will loose the data held in the following sections if you do. To speed up writing tapes with large numbers of blocks, the "-a" flag (append) can be used in place of "-s", so tell TAPEIO to find the end of the current data, and start a new section there. In addition, you can use TAPEIO to count the number of sections present on your tape. Simply use the "-s?" syntax, and the program scans the tape from start to finish, counting the sections it encounters along the way. At the end, the count is displayed to you. If you want the -s? result displayed in a particular format (for example, as a variable that the shell can collect), then use the -f option. The following batch script shows how this logic could be used.. tapeio -s? -f"SET N=~" > tmp.bat
call tmp.bat
del tmp.bat
echo Tape has %N% sections
The '~' (tilde) character is used as the place-holder for the actual counter returned 4: Logical formatting (use of tape marks)Tapeio follows the Unix 5.4 convention that every "section" on the tape is terminated with a FILEMARK, including the last one. The end of data is flagged with an ENDOFDATA mark. Thus the number of sections and the number of FILEMARKS are the same, and an empty tape consists simply of an ENDOFDATA mark. Tapes that do not follow this formatting convention will cause Tapeio to misbehave. Possible differences of tape formatting which could cause problems are..
Future releases of Tapeio MAY resolve some of these limitations. [For the meanings of the words FILEMARK, SETMARK, ENDOFDATA and PARTITION, see the Win32 programmer's reference - chapter on the "Tape Backup" system service] 5: Tape copyingTapeio also provides a facility for copying tapes, including data from all the sections of the tape, duplicating the block sizes. The "-ri" syntax reads a full image of the tape contents and writes it to the standard output using an "internal" binary format. The "-wi" syntax reverses the process. So to copy a tape you can dump its contents to a file, and then restore, thus.. tapeio -ri > file To dump tape contents to disk tapeio -wi < file To copy back to tape Or combine these syntaxes, piped together on a machine with more than one tape drive, thus.. tapeio -ri -t0 | tapeio -wi -t1 Tapeio Usage summarytapeio -?|-??|-x
tapeio -r [-j] [-t#] [-s#] | COMMAND-NAME
tapeio -ri [-j] [-t#] | COMMAND-NAME
COMMAND-NAME | tapeio -w [-j] [-t#] [-a|-e|-s#] [-b#] [-n]
COMMAND-NAME | tapeio -wi [-j] [-t#] [-e]
tapeio -e [-j] [-t#]
tapeio -j [-t#]
tapeio -b? [-j] [-t#] [-s#] [-f"format"]
tapeio -s? [-j] [-t#] [-f"format"]
-? to display disclaimer and registration information (please read!)
-?? to display the full README text, including notes and hints on use
-x to display some brief examples of use
-r to read one section from tape device (copy tape => stdout)
-ri to read entire tape image (copy full tape => stdout)
-w to write one section to tape device (copy stdin => tape)
-wi to write full image to tape (copy stdin => tape)
-e to erase the tape [from the start]
-a to append one section (skip to end of tape, and write)
-j to eject the tape [when finished]
-t# specify the tape device number (0=first/default)
-s# specify the tape section number (1=first/default)
-s? to count the number of sections on the tape
-b# specify the blocksize (default = 512, SCO Unix = 1024)
-b? to measure blocksize of the first block in the section
-n to prevent 'padding' the last block with nulls
-f specify result format ('~' is value placeholder)
Tapeio ExamplesCommand line Description ---------------------------- ------------------------------ tapeio -r | tar xvf - Restores a TAR tape tar cf - . | tapeio -w -s2 Saves current dir to section 2 of tape dir /b | cpio -oc | tapeio -w Saves files in current dir to tape tapeio -r -j > tape.dat Dumps tape contents (section 1) and ejects tapeio -e -t3 Erase tape in drive 3 tapeio -r | tapeio -w -t1 -e Copy from tape drive 0 to drive 1 tapeio -j Eject the tape tapeio -? Display full disclaimer text tapeio -?? Display the full readme text tapeio -s? -t2 -f"SET N=~" Count the sections on tape in drive 2 tapeio -ri > tape.dat Dump entire tape contents to file tapeio -wi -j < tape.dat Restore entire tape contents, and eject tapeio -ri | tapeio -wi -t1 Copy entire tape from drive 0 to drive 1 Disclaimer/WarningsBy running the program, you are deemed to agree to the following terms and conditions of use.. In summary:
In more detail:
Obtaining a copy of tapeio
To download TAPEIO, Just grap a copy from here. If you want to encourage me, send me an e-mail to tell me that you have taken a copy, and what you are going to use it for. |