Article View: comp.sys.next.sysadmin
Article #304Re: WangDAT: How to fseek() ?
From: Louis A. Mamakos
Date: Wed, 29 Jul 1992 23:34
Date: Wed, 29 Jul 1992 23:34
45 lines
2897 bytes
2897 bytes
In article <1992Jul29.112201.9064@mic.ucla.edu> iwelch@agsm.ucla.edu (Ivo Welch) writes: > >> There is no "built-in" support for random seeking to blocks on DAT >> tape media, but it is not too difficult to issue "raw" SCSI commands >> to the tape driver with the appropriate commands to perform the >> seeking. > >Yes, but the question remains: WHAT ARE THE COMMANDS TO DO SO FOR WANGDATS? Well, I don't know what they are on a WangDAT drive; the code that I wrote for an Archive Python uses the SCSI-2 standard positioning commands for sequential access devices. The specific commands are LOCATE (0x2B) and READ POSITION (0x34). You use the MTIOCSRQ ioctl to issue raw SCSI commands to the tape device that you have open. >(I got 4 messages asking me to forward any responses; unfortunately I have not >received any). Again, has anybody written C functions that can substitute for >fseek() and ftell() (probably over the whole tape, rather than a file, which >would be just fine). Well, you can't write direct substitutes for fseek() and ftell() which return file positions which on the NeXT (and most UNIX platforms) are byte offsets. The code that I wrote treats the 4 byte quantities returned by LOCATE as opaque values; it turns out that they (on the Archive Python, at least) number tape blocks, including file marks. That's why I mentioned that you need someway to construct a database or index of these values, preferably while you are writing the tape. >I can no longer get a hold of the author of Safteynet, nor will Safetynet do >what I need: maintaining data-bases to be read by programs. I do not primarily >want to increase dump/tar/etc speed!! You can try <brian@Systemix.COM> to get further information about the SafetyNet program. Alternatively, you can get get the OEM or programmer's manual for the WangDAT drive and/or a SCSI-2 speci and combine that with 'man 4 st' and 'man 4 sg' to hack up some code to do what you'd like. As I mentioned, I don't know for certain if the WangDAT uses LOCATE and READ POSITION commands or some vendor specific commands. The Archive Python, for instance, provide the SCSI-2 LOCATE/READ POSITION as well as some vendor specific commands that do much the same sort of thing, but the tape positions are encoded differently. louie
Technical Details
Message-ID:
<1992Jul29.233415.26017@ni.umd.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!haven.umd.edu!ni.umd.edu!sayshell.umd.edu!louieReferences:
<nq9sp2o@zuni.esd.sgi.com> <1992Jul28.215226.9960@ni.umd.edu> <1992Jul29.112201.9064@mic.ucla.edu>Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.sysadmin Path: arc1-ca.pugleaf.net!sparky!uunet!haven.umd.edu!ni.umd.edu!sayshell.umd.edu!louie From: louie@sayshell.umd.edu (Louis A. Mamakos) Subject: Re: WangDAT: How to fseek() ? Message-ID: <1992Jul29.233415.26017@ni.umd.edu> Keywords: cron Sender: usenet@ni.umd.edu (USENET News System) Nntp-Posting-Host: sayshell.umd.edu Organization: University of Maryland College Park References: <nq9sp2o@zuni.esd.sgi.com> <1992Jul28.215226.9960@ni.umd.edu> <1992Jul29.112201.9064@mic.ucla.edu> Date: Wed, 29 Jul 1992 23:34:15 GMT Lines: 45