[comp.sys.dec] 2 questions: VAX-C RTL calls and VMS .DIR file entries

still@usceast.UUCP (Bert Still) (06/10/87)

Hi There,

	I have 2 (possibly) strange questions for netland. The first concerns
the VAX-C run-time library. Listed in the VAX-C manual are references to some
run-time functions that are otherwise undocumented. I did a lib/list on the
VAXCRTL.OLB file and verified that the following routines do exist:

	shell$from_vms	-- translate VMS filespecs to UNIX filespecs
	shell$to_vms    -- translate UNIX filespecs to VMS filespecs
	shell$cli_name  -- determine user's command interpreter
	shell$fix_time  -- convert VMS time to UNIX format
	shell$clint     -- interface to argument lists under shell
	shell$wild      -- wildcard expansion to infinite names.

Does anyone have a copy of the correct calling sequences for these ? (I have
tried to experiment, and can guess at some of the arguments, like string
descriptors, etc. but I cannot seem to get them all.) We do not run DEC/Shell
(yet, we probably will buy it in the future), and I suspect that the answer
lies therein. In the meantime, can some kind soul please send me a copy of
the calling sequences to any/all of the above?

	The second question concerns VMS directories. I have perused the
"orange manuals" for the last two weeks looking for something that describes
the VMS directory files' organization. So far, by dumping the contents of
several .DIR files, I have determined that the entries begin with 32767, and
filenames are followed by an ASCII null (\0), and that the version number
immediately follows the filename. Does anyone have a complete description of
an entry in a .DIR file, or know where I can find the information?

(For the curious, I am trying to convert some systems programs that I have
from BSD UNIX to run under VMS, and I need the OPENDIR, READDIR, CLOSEDIR, and
IOCTL functions; hence, I am trying to write them, and meeting with little
success... any help will be greatly appreciated.)
PS. If anyone has any of these functions written for VMS, I would be extremely
appreciative of any advice/aid I might receive.

                                                      Bert  8-}

--------------------------------------------------------------------------------
       What DesCartes really meant was "I think; therefore, I am paid."
--------------------------------------------------------------------------------
    ("shar" is actually an ancient term meaning "some assembly required.")
--------------------------------------------------------------------------------
                                     #
UUCP:   {...ihnp4!akgua |            #  US SNAIL:  Bert Still
         ...seismo!ncr-sd!ncrcae}    #             Dept of Mathematics
                      !usceast!still #             University of South Carolina
                                     #             Columbia, SC 29208
BITNET: T410119@UNIVSCVM             #
                                     #
--------------------------------------------------------------------------------

jimp@cognos.uucp (Jim Patterson) (06/26/87)

In article <2405@usceast.UUCP> still@usceast.UUCP (Bert Still) writes:
>
>Hi There,
>	The second question concerns VMS directories. I have perused the
>"orange manuals" for the last two weeks looking for something that describes
>the VMS directory files' organization.
>(For the curious, I am trying to convert some systems programs that I have
>from BSD UNIX to run under VMS, and I need the OPENDIR, READDIR, CLOSEDIR, and
>IOCTL functions)

Rather than trying to decode the VMS directory structures, you might
be better off to use the RMS directory search primatives.  You could
set up the following equivalences:

OPENDIR - establishes the directory name, and sets up SYS$SEARCH using
the given directory name and a filename of *.*;* .  (You may need to
call SYS$PARSE at this point).

READDIR - calls SYS$SEARCH to retrieve the next filename and store
information about it into the FAB (File Access Block) and NAMe
structures (plus any XABs you may need).  You can then move whatever
information is appropriate into the directory structure your program
expects.

CLOSEDIR - can just free up the various control structures.

I don't know where IOCTL fits in.

There are RTL routines that are similar (LIB$FIND_FILE, etc.).
If all you need are names of files, these may be sufficient.


-- 

Jim Patterson          decvax!utzoo!dciem!nrcaer!cognos!jimp
Cognos Incorporated