OSI/FTAM Programming Guide
NonStop FTAM Programming Examples
HP NonStop OSI/FTAM Programming Guide—528612-001
5-30
Reading a File: C Programming Example
1047 /* the remote file. If string-significance is 0 (variable), */
1048 /* a file with code 892 and type E (Enscribe entry-sequenced) */
1049 /* is created. If it is 1 (fixed), a file with code 891 and type */
1050 /* E is created. Ifstring-significance is 2 (not-significant), */
1051 /* a file withcode 0 and type U (unstructured) is created. */
1052 /******************************************************************/
1053
1054
1055 switch ( contents_type.u_zcntntstype.zdoctype.zstringsig )
1056 {
1057 case 0 : file_code = 892;
1058 file_type = 0x0002;
1059 break;
1060
1061 case 1 : file_code = 891;
1062 file_type = 0x0002;
1063 break;
1064
1065 case 2 : file_code = 0;
1066 file_type = 0;
1067 break;
1068
1069 default : printf ( "Invalid String Significance received\n" ); ;
1070 exit (EXIT_FAILURE);
1071
1072 } /* end switch */
1073
1074
1075 if ( CREATE ( local_file,, file_code,, file_type,
1076 (int) contents_type.u_zcntntstype.zdoctype.zmaxstringlen,
1077 data_blocklen ) != CCE )
1078 {
1079 FILEINFO ( local_fn, (int *) &error );
1080 printf ( "CREATE for local file failed with error # %d\n", error );
1081 exit (EXIT_SUCCESS);
1082 }
1083
1084 if ( OPEN ( local_file, (int *) &local_fn ) != CCE )
1085 {