OSI/FTAM Programming Guide

NonStop FTAM Programming Examples
HP NonStop OSI/FTAM Programming Guide528612-001
5-61
Writing a File: TAL Programming Example
739 ! Use the FTM procedures FTM_CREATE_REQ_ and FTM_OPEN_REQ_ !
740 ! to create and open the remote file. These two requests !
741 ! are processed as a group. !
742 !------------------------------------------------------------------!
743
744 !------------------------------------------------------------------!
745 ! Initialize parameters for the FTM_CREATE_REQ_ procedure call. !
746 !------------------------------------------------------------------!
747
748 !------------------------------------------------------------------!
749 ! Set contents_type for the remote file used for initial_attr !
750 ! and FTM_OPEN_REQ_ call. !
751 !------------------------------------------------------------------!
752
753 contents_type.zid := ZFTM^VAL^CNTNTSTYPE^DOCTYPE;
754 contents_type.zdoctype.zdoctypename.znum^elements := NUM_ELEM;
755 contents_type.zdoctype.zdoctypename.zobj^id ':=' ftam_doc_type FOR
756 NUM_ELEM WORDS;
757 contents_type.zdoctype.zuniversalclassispresent := ZAPS^VAL^PRESENT;
758 contents_type.zdoctype.zuniversalclass := uc_char_string;
759 contents_type.zdoctype.zmaxstringlenispresent := ZAPS^VAL^PRESENT;
760 contents_type.zdoctype.zmaxstringlen := max_string_len;
761 contents_type.zdoctype.zstringsigispresent := ZAPS^VAL^PRESENT;
762 contents_type.zdoctype.zstringsig := ZFTM^VAL^STRINGSIG^NOTSIG;
763 contents_type.zdoctype.zfileattrsispresent := ZAPS^VAL^ABSENT;
764
765 !------------------------------------------------------------------!
766 ! Set up the initial file attributes for the file to be created. !
767 !------------------------------------------------------------------!
768
769 ! Kernel Group !
770 initial_attr.zfilename.zlen := $occurs(remote_file_name);
771 initial_attr.zfilename.zb ':=' remote_file_name
772 FOR initial_attr.zfilename.zlen BYTES;
773 initial_attr.zpermittedactions.zread := ZAPS^VAL^TRUE;
774 initial_attr.zpermittedactions.zinsert := ZAPS^VAL^FALSE;
775 initial_attr.zpermittedactions.zreplace := ZAPS^VAL^TRUE;
776 initial_attr.zpermittedactions.zextend := ZAPS^VAL^TRUE;
777 initial_attr.zpermittedactions.zerase := ZAPS^VAL^TRUE;