From:	SMTP%"carl@SOL1.GPS.CALTECH.EDU" 24-JUN-1994 16:24:00.73
To:	EVERHART
CC:	
Subj:	Re: Strange RMS file

From: carl@SOL1.GPS.CALTECH.EDU (Carl J Lydick)
X-Newsgroups: comp.os.vms
Subject: Re: Strange RMS file
Date: 24 Jun 1994 07:23:25 GMT
Organization: HST Wide Field/Planetary Camera
Lines: 94
Distribution: world
Message-ID: <2ue1ld$nd1@gap.cco.caltech.edu>
Reply-To: carl@SOL1.GPS.CALTECH.EDU
NNTP-Posting-Host: sol1.gps.caltech.edu
To: Info-VAX@CRVAX.SRI.COM
X-Gateway-Source-Info: USENET

In article <1994Jun24.050158.10723@news.datasrv.co.il>, softlink@zeus.datasrv.co.il (SoftLink) writes:
=Just to make things clear:
=
=what you say is that i can skip linking the XABALL to the XAB chains, and
=use all the other XABS (which did a very good job till now in reproducing
=the file structure, including record attributes)

The record attributes are in the file header, and are dealt with by RMS via the
FAB.

=and by using the BIO QIO the XABALL will be written to the file correctly ?

No need to resort to SYS$QIO.  You can do this via RMS.

What he's saying is that the information from the XABs you're using isn't
stored in the file header.  It's stored in the body of the file.  Hence there's
no need for you to use these XABs if you're simply copying the file.  The
following, for example, should do what you want, if I remember your original
question correctly:

#include descrip
#include rms
#include ssdef
notlib_copy(struct dsc$descriptor *inp_file, struct dsc$descriptor *out_file)
{	struct FAB inp_fab, out_fab;
	struct RAB inp_rab, out_rab;
	char buffer[32256];
	long stat;

	inp_fab = cc$rms_fab;
	inp_fab.fab$b_fac = FAB$M_BIO | FAB$M_GET;
	inp_fab.fab$l_fna = inp_file->dsc$a_pointer;
	inp_fab.fab$b_fns = inp_file->dsc$w_length;
	inp_fab.fab$l_fop = FAB$M_SQO;
	inp_fab.fab$b_shr = FAB$M_SHRPUT | FAB$M_UPI;
	if(((stat = SYS$OPEN(&inp_fab)) & 7) != 1)
		return stat;
	inp_rab = cc$rms_rab;
	inp_rab.rab$l_fab = &inp_fab;
	inp_rab.rab$l_rop = RAB$M_BIO;
	if(((stat = SYS$CONNECT(&inp_rab)) & 7) != 1)
	{	SYS$CLOSE(&inp_fab);
		return stat;
	}
	out_fab = inp_fab;
	out_fab.fab$b_fac = FAB$M_BIO | FAB$M_PUT;
	out_fab.fab$l_fna = out_file->dsc$a_pointer;
	out_fab.fab$b_fns = out_file->dsc$w_length;
	out_fab.fab$w_ifi = 0;
	out_fab.fab$b_shr = FAB$M_SHRPUT | FAB$M_UPI;
	if(((stat = SYS$CREATE(&out_fab)) & 7) != 1)
	{	SYS$CLOSE(&inp_fab);
		return stat;
	}
	out_rab = inp_rab;
	out_rab.rab$l_fab = &out_fab;
	out_rab.rab$w_isi = 0;
	if(((stat = SYS$CONNECT(&out_rab)) & 7) != 1)
	{	SYS$CLOSE(&inp_fab);
		SYS$CLOSE(&out_fab);
		return stat;
	}
	inp_rab.rab$l_ubf = buffer;
	inp_rab.rab$w_usz = 32256;
	out_rab.rab$l_rbf = buffer;
	while(1==1)
	{	if((((stat = SYS$READ(&inp_rab)) & 7) != 1) && stat != RMS$_EOF)
		{	SYS$CLOSE(&inp_fab);
			SYS$CLOSE(&out_fab);
			return stat;
		}
		else if(stat == RMS$_EOF)
		{	SYS$CLOSE(&inp_fab);
			SYS$CLOSE(&out_fab);
			return RMS$_NORMAL;
		}
		else
		{	out_rab.rab$w_rsz = inp_rab.rab$w_rsz;
			if(((stat = SYS$WRITE(&out_rab)) & 7) != 1)
			{	SYS$CLOSE(&inp_fab);
				SYS$CLOSE(&out_fab);
				return stat;
			}
		}
	}
}
--------------------------------------------------------------------------------
Carl J Lydick | INTERnet: CARL@SOL1.GPS.CALTECH.EDU | NSI/HEPnet: SOL1::CARL

Disclaimer:  Hey, I understand VAXen and VMS.  That's what I get paid for.  My
understanding of astronomy is purely at the amateur level (or below).  So
unless what I'm saying is directly related to VAX/VMS, don't hold me or my
organization responsible for it.  If it IS related to VAX/VMS, you can try to
hold me responsible for it, but my organization had nothing to do with it.

