home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / aix / 11489 < prev    next >
Encoding:
Text File  |  1992-11-11  |  2.1 KB  |  51 lines

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