OSI/FTAM Programming Guide

NonStop FTAM Programming Examples
HP NonStop OSI/FTAM Programming Guide528612-001
5-9
Reading a File: C Programming Example
228 /*********************************************************************/
229 /* */
230 /* Name: main */
231 /* */
232 /* Description: This application initiates and manages a simple */
233 /* file transfer. This procedure creates and opens */
234 /* a local file, and closes it after FTAM operations */
235 /* are complete. */
236 /* */
237 /*********************************************************************/
238
239 main ()
240
241 {
242
243 /******************************************************************/
244 /* Allocate and initialize a segment used by the FTM and APS */
245 /* procedures. */
246 /******************************************************************/
247
248 error = APS_INITIALIZE_ ( /* swap-vol */ );
249 if ( error != ZAPS_ERR_OK )
250 {
251 printf ( "Initialization of the FTAM/APS segment failed\n" );
252 exit(EXIT_SUCCESS);
253 }
254
255
256 ftam_regime ();
257
258
259 if ( local_fn != -1 )
260 {
261 if ( CLOSE ( local_fn ) != CCE )
262 {
263 printf ( "Close for local file failed\n" );
264 exit (EXIT_SUCCESS);
265 }
266 }