OSI/FTAM Programming Guide

NonStop FTAM Programming Examples
HP NonStop OSI/FTAM Programming Guide528612-001
5-52
Writing a File: TAL Programming Example
388 , ! next-record-pointer !
389 , ! last-modtime !
390 , ! filecode !
391 , ! secondary-extent-size !
392 , ! current-record-pointer !
393 , ! open-flags !
394 , ! subdevice !
395 , ! owner !
396 , ! security !
397 , ! num-extents-allocated !
398 , max_filesize );
399 IF <> THEN
400 BEGIN
401 tempbuf ':=' "Operation on local file failed with error #" -> @text_ptr;
402 @text_ptr := @text_ptr + DNUMOUT ( text_ptr
403 , $DBL (error)
404 , BASE );
405 text_len := @text_ptr - @tempbuf;
406 CALL WRITE ( termnum, outbuf, text_len );
407 CALL STOP;
408 END;
409
410 !---------------------------------------------------------------------!
411 ! Before the OPEN^FILE call, the logical file name for the local file !
412 ! is assigned as "FTAMFLE" by the first SET^FILE call. The physical !
413 ! file name is set by the CHECK^FILE call and by subsequently setting !
414 ! file^ptr. The second SET^FILE call sets the type of access. !
415 ! Variables tempbuf and outbuf are equivalent. !
416 !---------------------------------------------------------------------!
417
418 tempbuf ':=' [7,"FTAMFLE"];
419 CALL SET^FILE ( FTAMFLE, assign^logicalfilename, @outbuf );
420 @file^ptr := CHECK^FILE( FTAMFLE, FILE^FILENAME^ADDR );
421 file^ptr ':=' local_file FOR 12 WORDS;
422 CALL SET^FILE ( FTAMFLE, assign^openaccess, read^access );
423 error := OPEN^FILE ( COMMFCB, FTAMFLE, block^buf, block^buf^len,
424 , ABORT^OPENERR, MAX_REC );
425 IF error <> 0 THEN
426 BEGIN