5 * Revision 1.1.1.1 1996/02/15 17:49:40 mclareni
10 CERN PROGLIB# Z311 CIOPEI .VERSION KERNOS9 1.01 940801
12 CALL CIOPEN (LUNDES, MODE, TEXT, ISTAT)
14 *LUNDES file descriptor
15 MODE string selecting IO mode
16 = 'r ', 'w ', 'a ', 'r+ ', ...
18 *ISTAT status, =zero if success
20 #include "kerngen/cf#open.h"
23 #include "kerngen/cf#xaft.h"
24 #include "kerngen/fortchar.h"
27 void ciopei_(lundes,mode,ftext,stat,lgtx)
29 int *lundes, *stat, *lgtx;
32 char *pttext, *fchtak();
55 flags = FAM_READ | FAM_WRITE;
57 } else if (mode[0] == 1) {
62 flags = FAM_WRITE | FAM_READ;
64 } else if (mode[0] == 2) {
67 flags = FAM_WRITE | FAM_APPEND;
69 flags = FAM_WRITE | FAM_READ | FAM_APPEND;
75 pttext = fchtak(ftext,*lgtx);
76 if (pttext == 0) return;
78 if (perm == 0) perm = FAP_READ | FAP_WRITE | FAP_PREAD;
81 if ( (fildes = create (pttext, flags, perm)) < 0 )
82 fildes = creat (pttext, flags);
84 fildes = open (pttext, flags);
86 (fildes < 0) ) fildes = create (pttext, flags, perm);
90 if (fildes < 0) goto errm;
96 /* perror (" error in CIOPEN"); */
101 /*> END <----------------------------------------------------------*/