VMS Help  —  CRTL  decc$from_vms, Example
        /* This example must be run as a foreign command        */
        /* and be supplied with an OpenVMS file specification.  */

        #include <unixlib.h>
        #include <stdio.h>

        int main(int argc, char *argv[])
        {
            int number_found;           /* number of files found */
            int print_name();           /* name printer          */

            printf("Translating: %s\n", argv[1]);
            number_found = decc$from_vms(argv[1], print_name, 1);
            printf("\n%d files found", number_found);
        }

        /* print the name on each line */
        print_name(char *name)
        {
            printf("\n%s", name);
            /* will continue as long as success status is returned */
            return (1);
        }

      This example shows how to use the decc$from_vms routine in
      VSI C. It produces a simple form of the ls command that
      lists existing files that match an OpenVMS file specification
      supplied on the command line. The matching files are displayed
      in UNIX style file specification format.
Close Help