From: MERC::"uunet!CRVAX.SRI.COM!RELAY-INFO-VAX" 9-JAN-1993 03:54:06.93 To: info-vax@sri.com CC: Subj: Re: RMS RAB & FAB for VAXC file >>Coming back from my Christmas I have read a long discussion about VAX C >>buffer flushing. Many people say that it is easy to get the RAB/FABs from >>a VAX C FILE * >> >>OK so how do you do it ??? It has been discussed here several times over the years. However said it was "easy" has mislead you, because it's an invitation to future problems. > Sorry, that was a mistake on my part. I was confusing two RTLs. From > the FORTRAN RTL, you can get the RAB from the LUN via the (undocumented, > last time I checked) routine FOR$RAB. There's no such routine (at least > under VMS v5.4-2 in the VAXC RTL), though Ehud had indicated that a > perusal of the listings will allow you to figure out how to find it. FOR$RAB is discussed briefly in the section of the FORTRAN manual (User's Guide) dealing with USEROPEN routines. So, I wouldn't classify it as undocumented. The routine for accessing VAXCRTL's RMS structures is undocumented and intended to be private to the library. If you link against the shareable image version of VAXCRTL you won't be able to use it at all. If you link with the object library, you will--until you try to move to DEC C and DECC$SHR that is. #include #include /* _fstat() is a private routine internal to VAXCRTL */ extern int _fstat(int, struct FAB **, struct NAM **, struct RAB **); ... FILE *fp = fopen(...); struct FAB *fab_p; struct NAM *nam_p; struct RAB *rab_p; int result = _fstat(fileno(fp), &fab_p, &nam_p, &rab_p); if ( result >= 0 ) { /* do something with one or more of the RMS blocks */ } It's also possible to derive a RAB pointer by doing some magic arithmetic on a FILE pointer, but that goes beyond undocumented and unsupported to _unsupportable_. I'd advise against doing that or using _fstat(). If you want access to RMS, then use RMS. Pat Rankin, rankin@eql.caltech.edu