OSI/FTAM Programming Reference Manual

NonStop FTAM Programming Examples
HP NonStop OSI/FTAM Programming Reference Manual528611-001
G-47
Example 1 in C—Updating a Remote File (in Nowait
Mode)
1364 /***************************************************************/
1365 /* Update the number of records that have been read. If */
1366 /* the maximum number of records has been read, then return to */
1367 /* the main control loop and wait for an I/O operation or */
1368 /* an FTAM event to complete. Otherwise, read another record */
1369 /* from the local Guardian file. */
1370 /***************************************************************/
1371
1372 records = records + 1;
1373 if ( records < MAX_RECORDS )
1374 {
1375 /**************************************************************/
1376 /* Read the next record from the file. */
1377 /**************************************************************/
1378
1379 condition_code = READX ( local_filenum
1380 , (char *) &local_buffer
1381 , MAX_READ_COUNT
1382 , /* count_read - waited I/O only */
1383 , READ_TAG );
1384
1385 if ( condition_code != CCE )
1386 {
1387 FILEINFO ( local_filenum, &error );
1388 printf ("Local file error %d\n", error);
1389 APS_DISCARD_ ( cepi );
1390 exit (EXIT_SUCCESS);
1391 }
1392
1393 /**************************************************************/
1394 /* Indicate that a local file read is in progress. */
1395 /**************************************************************/
1396
1397 local_read_io_cmplt = FALSE;
1398
1399 }
1400
1401 }
1402