home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / next / sysadmin / 7610 < prev    next >
Encoding:
Text File  |  1993-01-25  |  2.2 KB  |  67 lines

  1. Xref: sparky comp.sys.next.sysadmin:7610 comp.sys.next.hardware:3404
  2. Newsgroups: comp.sys.next.sysadmin,comp.sys.next.hardware
  3. Path: sparky!uunet!mcsun!inesc.inesc.pt!pombo!pmelo
  4. From: pmelo@pombo.inescc.pt (Paulo Melo)
  5. Subject: NeXT and Archive Tape Drives - SOLUTION
  6. Message-ID: <1993Jan25.120433.13206@pombo.inescc.pt>
  7. Followup-To: comp.sys.next.hardware,poster
  8. Summary: A solution for the problem of using Archive Tape drives on NeXT
  9. Keywords: Solution Archive Tape Drives SCSI
  10. Organization: INESC - Nucleo de Coimbra
  11. Date: Mon, 25 Jan 1993 12:04:33 GMT
  12. Lines: 53
  13.  
  14.  
  15.     Some time ago I made a posting asking about possible solutions for a
  16.     Archive Tape drive in which the tape control commands worked, but
  17.     the data transfer didn't. 
  18.  
  19.     As promised, here goes a solution that works (well, it worked for
  20.     me :-). The following is a little C program I compiled and put on 
  21.     my rc.local, that set's the transfer settings for use of fixed 512
  22.     bytes blocks.  This code is taken from NeXTanswers. (BTW, if you still 
  23.     don't have it, go and get NeXTanswers. It's a great place to search 
  24.     for NeXTinformation needed for both users and sysadmins).
  25.  
  26. ----------------------------------------------------------------------
  27.  
  28. /*
  29. * The following code configures the SCSI tape driver for /dev/rst0
  30. * to support fixed-sized data transfers of 512 bytes each.
  31. */
  32.  
  33. #include <sys/types.h>
  34. #include <sys/file.h>
  35. #include <nextdev/scsireg.h>
  36.  
  37.  
  38. main()
  39. {
  40.         int    fd, error;
  41.         int    blocksize = 512; /* or whatever block size your tape likes*/
  42.  
  43.         fd = open("/dev/rst0", O_RDWR, 777);
  44.         if (ioctl(fd, MTIOCFIXBLK, &blocksize))
  45.         {
  46.             perror("ioctl failedn");
  47.             return 1; 
  48.         }
  49.         close (fd);
  50.         return 0;
  51. }
  52.  
  53. -------------------------------------------------------------------
  54.  
  55. Objnote: If you compile this code with NeXTStep 3.0 with will warn you
  56. about using old (version 2.0) headers. Forget the warnings. I didn't,
  57. and the code I compiled with the 3.0 headers didn't work. You have been
  58. warned.
  59.  
  60. Objthanks: I would like to thank jimc@tau-ceti.isc-br.com (Jim Cathey),
  61. harit@kripalu.com (Harit) and lliou@sdcc3.UCSD.EDU (Lily Liou) for their
  62. kind help and answers to my request. Thanks, boys and girls.
  63.  
  64. -- 
  65.  Paulo Melo      | "once again the sound of crying
  66.  pmelo@inescc.pt |  is #1 across the earth..."     Prefab Sprout
  67.