OSI/FTAM Programming Reference Manual

NonStop FTAM Programming Examples
HP NonStop OSI/FTAM Programming Reference Manual528611-001
G-19
Example 1 in C—Updating a Remote File (in Nowait
Mode)
271 /* */
272 /* Name: insert */
273 /* */
274 /* Description: The insert program, written in nowait mode, updates */
275 /* a file on a remote system of an OSI network by */
276 /* inserting five records in it. This application */
277 /* initiates and manages the data transfer. It reads */
278 /* the data transferred from a local Guardian file. */
279 /* */
280 /* Input: None */
281 /* */
282 /* Output: None */
283 /* */
284 /**********************************************************************/
285
286 main ()
287
288 {
289 char main_buffer[36];
290
291 /*******************************************************************/
292 /* Open the local Guardian file for reading in nowait mode. */
293 /*******************************************************************/
294
295 strcpy( main_buffer, local_file );
296 condition_code = OPEN ( (int *) main_buffer
297 , &local_filenum
298 , OPEN_FLAGS);
299
300 if ( condition_code != CCE )
301 {
302 FILEINFO ( local_filenum, &error );
303 printf ("Local file open error %d\n", error);
304 exit (EXIT_SUCCESS);
305 }
306
307 /*******************************************************************/
308 /* Allocate and initialize a segment used by the FTM and APS */
309 /* procedures. */