[comp.os.vms] NEWS Posting

JOHNM@VAXC.CC.MONASH.EDU.AU (John Mann) (08/03/88)

Path: vaxc!johnm
From: johnm@vaxc.cc.monash.edu.au
Newsgroups: comp.os.vms
Subject: Re: VMS backup format
Message-ID: <61@vaxc.cc.monash.edu.au>
Date: 4 Aug 88 02:20:39 GMT
References: <775@nmtsun.nmt.edu>
Organization: Computer Centre, Monash University, Australia
Lines: 90

In article <775@nmtsun.nmt.edu> hydrovax@nmtsun.nmt.edu (M. Warner Losh) writes:
>I just pulled a program called from the archives called vmsbackup.  It
>was supposed to read vmsbackup tapes on a UNIX box.  Ha!  It doesn't
>calculate the file sizes correctly for really big files.  So, since
>the source has very little in the way of documentation on what it is
>doing, could someone please send me the format of a VMS-BACKUP save
>set?  I am running VMS 4.5.

"vmsbackup" was originally written using the VMS V3.0 VAX-11 Utilities 
Reference Manual Appendix B "Backup Media Formats", and much experimentation.
The author, John Carey, borrowed the copy on my bookshelf (name dropping :-).
I don't think the format is described in more recent manuals.

The description of the file format in the manual is incomplete, but a little 
experimentation (and reading of $XABFHCDEF) leads me to conclude that the EOF 
virtual block number is 32 bits long and is stored stored word swapped in 
the RMS record attributes field in the file.

This suggests the following mod:

*** vmsbackup.c_3.2	Fri May 22 10:41:37 1987
--- vmsbackup.c	Wed Aug  3 23:54:08 1988
***************
*** 2,4
   *
!  *   vmsbackup - version 3.2 - see README for more details
   *

--- 2,4 -----
   *
!  *   vmsbackup - version 3.3 - see README for more details
   *
***************
*** 238,240
  	char	*p, *q;
! 	short	dsize, nblk, lnch;
  

--- 238,240 -----
  	char	*p, *q;
! 	unsigned short	dsize, nblkh, nblk, lnch;
  
***************
*** 300,301
  #ifndef	SWAP
  	bcopy(&p[10], &nblk, sizeof(short));

--- 300,302 -----
  #ifndef	SWAP
+ 	bcopy(&p[8], &nblkh, sizeof(short));
  	bcopy(&p[10], &nblk, sizeof(short));
***************
*** 303,304
  #else
  	swap(&p[10], &nblk, sizeof(short));

--- 304,306 -----
  #else
+ 	swap(&p[8], &nblkh, sizeof(short));
  	swap(&p[10], &nblk, sizeof(short));
***************
*** 306,308
  #endif
! 	filesize = (nblk-1)*512 + lnch;
  #ifdef DEBUG

--- 308,310 -----
  #endif
! 	filesize = (nblkh*65536 + nblk-1)*512 + lnch;
  #ifdef DEBUG
***************
*** 308,310
  #ifdef DEBUG
! 	printf("nbk = %d, lnch = %d\n", nblk, lnch);
  	printf("filesize = 0x%x\n", filesize);

--- 310,312 -----
  #ifdef DEBUG
! 	printf("nblkh = %d, nblk = %d, lnch = %d\n", nblkh, nblk, lnch);
  	printf("filesize = 0x%x\n", filesize);

>Many thanks for your time,
>Warner

Hope this helps,
John Mann
---
John Mann, Systems Programmer, Computer Centre, Monash Uni. VIC 3168, Australia
Internet: johnm@vaxc.cc.monash.edu.au   Phone: +61 3 565 4774
ACSnet:   johnm@vaxc.cc.monash.oz