HP C/iX Library Reference Manual (30026-90004)
18 Chapter2
HP C/iX Library Input and Output
HP C/iX Library Input and Output
a null character. Whether or not padding is applied depends on the file type of the input
batch stream file.
If the batch stream file is a variable record length ASCII file, no padding is applied and
reading from stdin in batch behaves the same as reading in interactive mode.
If the batch stream file has fixed record lengths, the input records are padded with trailing
blanks. When reading from fixed record length batch stream files, be sure to use large
enough buffers to accommodate the entire record, including the null character appended to
the string by the I/O system.
Whether using fixed or variable record length ASCII files, insert the EOD command in the
batch stream file between the embedded program data and the next MPE/iX command.
This prevents the program from accidentally reading command lines from the file.
For example, given the following program
#include stdio.h>
main (void)
{
char iobuff[81];
printf("\n Please enter your name:");
gets(iobuff);
printf("%s\n",iobuff);
}
a batch job to run this program is:
!JOB WALTER.JONES
!RUN ECHONAME
Walter Morgan
!EOD
!SHOWTIME
!EOJ
Restrictions
Due to the implementation of the HP C/iX library and the MPE/iX file system, operations
on certain types of files may be restricted. Refer to appendix B, "Restrictions and Special
Considerations," for more information.