VMS Help  —  CRTL  system  Example
        #include <stdlib.h>
        #include <stdio.h>
        #include <unistd.h>     /* write, close */
        #include <fcntl.h>      /* Creat */

        main()
        {
            int status,
                fd;

            /* Creat a file we are sure is there        */

            fd = creat("system.test", 0);
            write(fd, "this is an example of using system", 34);
            close(fd);

            if (system(NULL)) {
                status = system("DIR/NOHEAD/NOTRAIL/SIZE SYSTEM.TEST");
                printf("system status = %d\n", status);
            }
            else
                printf("system() not supported.\n");
        }

    Running this example program produces the following result:

    DISK3$:[JONES.CRTL.2059.SRC]SYSTEM.TEST;1
                               1
    system status = 1
Close Help