From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7344,63f3017f943b021 X-Google-Attributes: gidf7344,public X-Google-Thread: f86d6,63f3017f943b021 X-Google-Attributes: gidf86d6,public X-Google-Thread: fc7fa,63f3017f943b021 X-Google-Attributes: gidfc7fa,public From: lvt-cfc@cyber2.servtech.com (christopher f. chiesa) Subject: Re: reading a tape with several diff block sizes Date: 1997/02/20 Message-ID: <5ei6le$bko@cyber2.servtech.com>#1/1 X-Deja-AN: 220211436 References: <01bc1ecd$1c3510e0$702835cf@robinkaryn> Organization: ServiceTech, Inc. Newsgroups: comp.os.vms,comp.sys.vms,vmsnet.sysmgt In article <01bc1ecd$1c3510e0$702835cf@robinkaryn>, Robin S Levine wrote: > >Need to read a tape that has several files on it, that are all blocked >differently and have >different blocksizes. Really have no desire to read it one char at a time >(too long). > >Would like to know if there is a way to mount a tape multiple times with >diff blocksizes >without rewinding it or any other suggestions you may have ? If I correctly understand what you want to do, there's no need to remount it at all. I read tapes with variable blocksizes all the time, with just one Mount. The one "gotcha" is this: you have to use MOUNT/FOREIGN, and if the files are ANSI you have to process the ANSI formatting YOURSELF. That being said, I would write a program that $ASSIGNed a channel to the tape drive and used $QIOW to read the tape in a block-by-block manner. Each $QIOW would request the "largest possible" blocksize -- 65535 bytes as of VAX/VMS V5.4-3; has the limit perhaps been upped in more recent VMS versions? -- and would look at the "byte transfer count" field of the associated I/O Status Block upon completion of the operation, to FIND OUT how many bytes, i.e. what size block, was ACTUALLY OBTAINED. Jacket this in whatever ANSI-format-interpretation logic you deem necessary, and VOILA -- no more problem. I've actually written a program like this, to recover ANSI-format files from a tape whose first half had gotten overwritten by a BACKUP saveset; that probably wasn't strictly necessary but I didn't know any better methods at the time. I'd offer you the program, but it is highly customized for the one particular tape I was working on, and moreover is written in Macro-32 assembly which most people don't seem to know... If none of this deters you, e-mail me for a copy. All in all, if you're not comfortable with system-service programming or the use of $QIOW in particular, this may be the "long way around the tree" for you, and you may be better off just biting the bullet and doing a DISMOUNT-and-reMOUNT sequence for each file... That may make it take longer (possibly MUCH longer, particularly if you're using a tape medium (e.g. 8mm Exabyte) that takes painfully long to do "repositioning") to read the tape, but may be more within your capabilities if you're a non- programmer. On the other hand, if you have many tapes to do, it might be worth the effort to write a program, or have someone else write one for you (e-mail me for info on THAT, too, if that's of interest ;-)). Hope this helps. You're welcome in advance! Chris Chiesa lvt-cfc@servtech.com