Thread View: comp.sys.next.sysadmin
1 messages
1 total messages
Started by Paulo Melo
Mon, 25 Jan 1993 12:04
NeXT and Archive Tape Drives - SOLUTION
Author: 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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads