OSI/FTAM Programming Reference Manual

NonStop FTAM Programming Examples
HP NonStop OSI/FTAM Programming Reference Manual528611-001
G-28
Example 1 in C—Updating a Remote File (in Nowait
Mode)
622 /****************************************************************/
623 /* The remote system is now set up for writing. Read the first */
624 /* record from the file into the local buffer. The file was */
625 /* opened in nowait mode. */
626 /****************************************************************/
627
628 condition_code = READX ( local_filenum
629 , (char *) &local_buffer
630 , MAX_READ_COUNT
631 , /* count_read - waited I/O only */
632 , READ_TAG );
633
634 if (condition_code != CCE)
635 {
636 FILEINFO ( local_filenum, &error );
637 printf ("Local file error %d\n", error);
638 APS_DISCARD_ ( cepi );
639 exit (EXIT_SUCCESS);
640 }
641
642 /****************************************************************/
643 /* Set flags to indicate that the remote I/O operation is com- */
644 /* plete (this to know that there are no outstanding I/O oper- */
645 /* ations) and that there is a local read I/O operation out- */
646 /* standing. */
647 /****************************************************************/
648
649 remote_io_cmplt = TRUE;
650 local_read_io_cmplt = FALSE;
651 break;
652
653 case DATA_TAG:
654 /****************************************************************/
655 /* An FTM data request has completed. Send the next record */
656 /* if the local file read has completed. */
657 /****************************************************************/
658
659 remote_io_cmplt = TRUE;
660