Article View: comp.sys.next.sysadmin
Article #2299NeXT and Archive Tape Drives - SOLUTION
From: Paulo Melo
Date: Mon, 25 Jan 1993 12:04
Date: Mon, 25 Jan 1993 12:04
53 lines
2291 bytes
2291 bytes
Some time ago I made a posting asking about possible solutions for a
Archive Tape drive in which the tape control commands worked, but
the data transfer didn't.
As promised, here goes a solution that works (well, it worked for
me :-). The following is a little C program I compiled and put on
my rc.local, that set's the transfer settings for use of fixed 512
bytes blocks. This code is taken from NeXTanswers. (BTW, if you still
don't have it, go and get NeXTanswers. It's a great place to search
for NeXTinformation needed for both users and sysadmins).
----------------------------------------------------------------------
/*
* The following code configures the SCSI tape driver for /dev/rst0
* to support fixed-sized data transfers of 512 bytes each.
*/
#include <sys/types.h>
#include <sys/file.h>
#include <nextdev/scsireg.h>
main()
{
int fd, error;
int blocksize = 512; /* or whatever block size your tape likes*/
fd = open("/dev/rst0", O_RDWR, 777);
if (ioctl(fd, MTIOCFIXBLK, &blocksize))
{
perror("ioctl failedn");
return 1;
}
close (fd);
return 0;
}
-------------------------------------------------------------------
Objnote: If you compile this code with NeXTStep 3.0 with will warn you
about using old (version 2.0) headers. Forget the warnings. I didn't,
and the code I compiled with the 3.0 headers didn't work. You have been
warned.
Objthanks: I would like to thank jimc@tau-ceti.isc-br.com (Jim Cathey),
harit@kripalu.com (Harit) and lliou@sdcc3.UCSD.EDU (Lily Liou) for their
kind help and answers to my request. Thanks, boys and girls.
--
Paulo Melo | "once again the sound of crying
pmelo@inescc.pt | is #1 across the earth..." Prefab Sprout
Technical Details
Message-ID:
<1993Jan25.120433.13206@pombo.inescc.pt>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!inesc.inesc.pt!pombo!pmeloShow Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.sysadmin,comp.sys.next.hardware Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!inesc.inesc.pt!pombo!pmelo From: pmelo@pombo.inescc.pt (Paulo Melo) Subject: NeXT and Archive Tape Drives - SOLUTION Message-ID: <1993Jan25.120433.13206@pombo.inescc.pt> Followup-To: comp.sys.next.hardware,poster Summary: A solution for the problem of using Archive Tape drives on NeXT Keywords: Solution Archive Tape Drives SCSI Organization: INESC - Nucleo de Coimbra Date: Mon, 25 Jan 1993 12:04:33 GMT Lines: 53