OSI/FTAM Programming Guide

NonStop FTAM Programming Examples
HP NonStop OSI/FTAM Programming Guide528612-001
5-51
Writing a File: TAL Programming Example
349 END;
350
351 CALL CLOSE ( fn );
352
353 !---------------------------------------------------------------------!
354 !Allocate and initialize a segment used by the FTM and APS procedures.!
355 !---------------------------------------------------------------------!
356
357 error := APS_INITIALIZE_ ( ! swapvol ! );
358 IF ( error <> ZAPS^ERR^OK ) THEN
359 BEGIN
360 tempbuf ':=' "Initialization of the FTAM/APS segment failed"
361 -> @text_ptr;
362 text_len := @text_ptr - @tempbuf;
363 CALL WRITE ( termnum, outbuf, text_len );
364 CALL STOP;
365 END;
366
367 error := FNAMEEXPAND (local_file_name, local_file, startup.default_vol );
368 IF error = 0 THEN
369 BEGIN
370 tempbuf ':=' "FNAMEEXPAND failed for local file" -> @text_ptr;
371 text_len := @text_ptr - @tempbuf;
372 CALL WRITE ( termnum, outbuf, text_len );
373 CALL STOP;
374 END;
375
376 !--------------------------------------------------------------------!
377 ! Call FILEINFO to get the maximum file size of the local file !
378 ! This size will be used to create a file on the remote system. !
379 !--------------------------------------------------------------------!
380
381 CALL FILEINFO ( ! filenum !
382 , error
383 , local_file
384 , ! ldevnum !
385 , ! devtype !
386 , ! extent-size !
387 , ! eof-pointer !