OSI/FTAM Programming Reference Manual

NonStop FTAM Programming Examples
HP NonStop OSI/FTAM Programming Reference Manual528611-001
G-123
Example 2 in C—Moving a File Between Two
Remote Systems (in Wait Mode)
661 /*******************************************************************/
662 /* Establish the source-file file-selection and file-open regimes. */
663 /*******************************************************************/
664
665 /*******************************************************************/
666 /* Use the FTM procedures FTM_SELECT_REQ_, FTM_READ_ATTRIB_REQ_, */
667 /* and FTM_OPEN_REQ_ to select the file, read the file attributes, */
668 /* and open the source file. These three requests are processed as */
669 /* a group. Initialize all necessary parameters. */
670 /*******************************************************************/
671
672 /*******************************************************************/
673 /* Initialize parameters for the FTM_SELECT_REQ_ procedure call. */
674 /*******************************************************************/
675
676 /*******************************************************************/
677 /* Initialize the file name according to the remote system */
678 /* requirements. */
679 /*******************************************************************/
680
681 src_file.zlen = strlen (src_filename);
682 memcpy ( src_file.u_zc.zb, src_filename, src_file.zlen );
683
684 /*******************************************************************/
685 /* Set the requested_access parameter to provide this */
686 /* application with read, read-attribute, and delete access on the */
687 /* remote source file that is being moved. */
688 /*******************************************************************/
689
690 requested_access.zread = ZAPS_VAL_TRUE;
691 requested_access.zinsert = ZAPS_VAL_FALSE;
692 requested_access.zreplace = ZAPS_VAL_FALSE;
693 requested_access.zextend = ZAPS_VAL_FALSE;
694 requested_access.zerase = ZAPS_VAL_FALSE;
695 requested_access.zreadattr = ZAPS_VAL_TRUE;
696 requested_access.zchngattr = ZAPS_VAL_FALSE;
697 requested_access.zdelete = ZAPS_VAL_TRUE;
698
699 /*******************************************************************/