home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.aix
- Path: sparky!uunet!destroyer!ncar!acd!pack
- From: pack@acd.acd.ucar.edu (Daniel Packman)
- Subject: rmt fix for AIX RS6000 3.2
- Message-ID: <1992Nov11.211647.3458@ncar.ucar.edu>
- Summary: perl script to get rmt talking to the non-ibm world
- Sender: news@ncar.ucar.edu (USENET Maintenance)
- Organization: Ntl Center for Atmospheric Research, Atmospheric Chemistry
- Date: Wed, 11 Nov 1992 21:16:47 GMT
- Lines: 39
-
- As I posted earlier, the rmt command on the RS6000/AIX3.2 passes ioctl
- requests directly to the local tape drive. Since the ibm ioctl numbers
- don't correspond to those usually used on other systems for the rmt
- command, rmt fails from hosts not consciously making an exception for
- the ibm ioctl call numbers. The following perl script, if installed in
- the place of the symbolic link /etc/rmt, will intercept and convert these
- ioctl calls. (remember that /bin/perl must either be the perl executable
- or must be a symbolic link to the executable).
-
-
- #!/bin/perl
- # Wrapper to convert input rmt requests to
- # AIX 3.2 ioctl numbers. We pass on all commands we don't understand
- # I0 MTWEOF -> I10 STWEOF write and end-of-file record
- # I1 MTFSF -> I11 STFSF forward space file
- # I2 MTBSF -> I12 STRSF reverse space file
- # I3 MTFSR -> I13 STFSR forward space record
- # I4 MTBSR -> I14 STRSR reverse space record
- # I5 MTREW -> I6 STREW rewind
- # I6 MTOFFL -> I5 STOFFL rewind and unload tape
- # I7 MTNOP -> I0 (no-op? should ignore following count)
- # I8 MTRETEN-> I8 STRETEN retension tape, leave at load point
- # I9 MTERASE-> I7 STERASE erase tape, leave at load point
- #I10 MTEOM (position to end of media ... no ibm equivalent?)
- #I11 MTNBSF (backward space file to BOF ... no ibm equivalent?)
- @iocs = (10,11,12,13,14,6,5,0,8,7);
- open(RMT,"|/usr/sbin/rmt") || die "Can't open pipe to rmt\n";
- select(RMT);
- $| = 1;
- while (<STDIN>) {
- s/(^I)(\d$)/I$iocs[$2]/;
- exit 0 if $_ =~ /^[Qq]/;
- print RMT $_ ; }
- exit 0;
-
- --
- Dan Packman NCAR INTERNET: pack@ncar.UCAR.EDU
- (303) 497-1427 P.O. Box 3000
- Boulder, CO 80307-3000 NSI/DECNET: 9583::PACK
-