(1:1) (2:3) (5:1) (6:1) (7:1) (8:2) (10:3) (13:1) (14:2)
-------------------------------------------------------------
Byte File No Tape CCTL Record Def. Ascii/ Domain
stream type? :File label format desig Binary
-------------------------------------------------------------
New!! 0=std 0=fix 0=file 0=new
1=ksam 1=var 1=$stdlist 1=old
2=rio 2=undef 2=$newpass 2=temp
3=ksam/xl 3=spool 3=$oldpass 3=either
4=cir 4=$stdin
5=nm spoofle 5=$stdinx
6=msg 6=$null
-------------------------------------------------------------
(2:1) (3:1) (4:1) (5:2) (7:1) (8:2) (10:1) (11:1) (12:4)
-------------------------------------------------------------
Glob File Nowait Multi Nobuf Excl Locking Multi Access
open Copy I/O Access acc record type
-------------------------------------------------------------
0=none 0=default 0=read
1=intra-job 1=exclusive 1=write
2=inter-job 2=excl+read 2=write/save
3=share 3=append
4=inout
5=update
6=execute
-------------------------------------------------------------
HPFOPEN (filenum, {32-bit integer by reference}
status, {32-bit integer by reference}
itemnum, {32-bit integer by value}
itemval, {type varies, by reference}
... {up to 41 pairs}
);
A few important things to remember:
the status is actually decoded as
two 16-bit values, Itemnum 2 the file name must
have an opening "quote" that also appears at the end,
you can open a new file and save it at the same time, and
you can open a file with mapped access.
FCLOSE Intrinsic on MPE
FCLOSE does at least five distinct functions:
FCLOSE(filenum {16-bit integer value }
,disposition {0=as is, 1=save, 2= temp}
{3=temp, no rewind, 4=delete}
{5=convert perm to temp NEW!!}
{.(11:2)=1 truncates, 2=trims}
,securitycode {1=tight, creator only}
);
if ((destfp = fopen(dest_file,"r")) == NULL)
fprintf(stderr, "error opening %s file\n", dest_file);
The access types are:
"r" : open for reading "w" : erase or create new empty "a" : append or create for writing "rb" : open binary file for reading "wb" : erase binary file or create empty "ab" : open binary file for appending "r+" : open for reading and writing "w+" : erase, open for reading/writing "a+" : retain contents, read/write "r+b" or "rb+" : open binary file for read/write "w+b" or "wb+" : erase binary file, read/write "a+b" or "ab+" : retain contents of binary file, read/write
int fclose(FILE *stream)
fclose() writes any buffered data for the named stream and
then closes it. This is automatic for all open files when
you call exit(2).