5 * Revision 1.2 1996/04/24 17:26:40 mclareni
6 * Extend the include file cleanup to dzebra, rz and tq, and also add
7 * dependencies in some cases.
9 * Revision 1.1.1.1 1996/03/06 10:47:23 mclareni
13 #include "zebra/pilot.h"
14 SUBROUTINE RZCDIR(CHPATH,CHOPT)
16 ************************************************************************
18 * To set,read or print the Current Working Directory
20 * *CHPATH* Character variable specifying the pathname of the CWD
22 * Unless several RZ files are open at the same time, the path
23 * name can be specified either as a path starting with the
24 * character '/', in which case an absolute pathname is
25 * intended for the given top directory. When several RZ files
26 * are open, an absolute pathname must start with a double
27 * slash '//' and the top directory. When the pathname does
28 * not start with a '/', the pathname is prefixed with the path
30 * CHPATH = ' ' means the CWD (useful with the 'U' option)
31 * CHOPT Character variable specifying the option
32 * 'R' Read the CWD pathname into CHPATH
35 * 'U' The same as the default but the time stamp in the
36 * directory in memory is checked against the one on the
37 * file and if needed the directory in memory is brought
38 * up to date. This option should be used when the user
39 * expects that directories can be changed concurrently
40 * by another user and he wants to use the latest version
41 * 'Q' quiet - do not print message if directory does not exist
42 * 'K' Keep current directory in memory. Do not drop
44 * *CHPATH* Character variable containing the complete pathname of the
45 * current working directory (with 'R' option only).
47 * Called by <USER>,RZINPA,RZLDIR
49 * Author : R.Brun DD/US/PD
51 * Last mod: 09.06.93 JDS. Protection against no RZ files open
53 * IQUEST(1) = 1 : RZIODO error
54 * 2 : unknown directory
55 * 3 : directory overwritten
56 * 4 : no control bank - RZFILE/RZMAKE not called
57 * 5 : no open files (RZEND called for all)
59 ************************************************************************
60 #include "zebra/zunit.inc"
61 #include "zebra/rzcl.inc"
62 #include "zebra/rzdir.inc"
63 #include "zebra/rzch.inc"
64 #include "zebra/rzclun.inc"
65 #include "zebra/rzk.inc"
67 EQUIVALENCE (IOPTR,IOPTV(1)), (IOPTP,IOPTV(2)), (IOPTU,IOPTV(3))
68 EQUIVALENCE (IOPTK,IOPTV(4)), (IOPTQ,IOPTV(5))
69 CHARACTER*(*) CHPATH,CHOPT
72 *-----------------------------------------------------------------------
74 #include "zebra/q_jbit.inc"
75 #include "zebra/q_jbyt.inc"
79 CALL UOPTC (CHOPT,'RPUKQ',IOPTV)
80 IF(IOPTK.NE.0) IOPTU=0
81 IF(IOPTR.NE.0) CHPATH = ' '
83 * Check for RZ control bank (i.e. did we call RZFILE/MAKE yet)
90 * Check that we have at least one RZ file still open
93 10 IF(LRZ.EQ.0) GOTO 20
94 IF(IQ(KQSP+LRZ-5).NE.0) GOTO 30
102 * Read Working directory
105 CALL RZPAFF(CHCDIR,NLCDIR,CHPATH)
109 * Print Working directory
112 CALL RZPAFF(CHCDIR,NLCDIR,CHL)
113 WRITE(IQPRNT,10000)CHL(1:LENOCC(CHL))
114 10000 FORMAT(' Current Working Directory = ',A)
118 * Set Working directory
119 * Mark old working directory to be dropped
120 * Write current directory if modified
123 IF(IOPTQ.NE.0) COPTQ = 'Q'
124 IF(LCDIR.NE.0.AND.ISAVE.NE.0.AND.IOPTK.EQ.0)THEN
126 40 IF(LBANK.NE.LTOP)THEN
129 CALL SBIT1(IQ(KQSP+LBANK),IQDROP)
131 CALL MZDROP(JQPDVS,LBANK,' ')
132 IQ(KQSP+LTOP+KIRIN)=0
135 IF(LBANK.NE.0)GO TO 40
139 * Read Top Dir In Case Of U Option
141 IF(IOPTU.NE.0)CALL RZRTOP
150 CALL RZFDIR('RZCDIR',LT,LDIR,COPTQ)
159 * Already set by RZFDIR
161 IF(LCDIR.NE.0)CALL SBIT0(IQ(KQSP+LCDIR),IQDROP)
165 LFREE = LQ(KQSP+LTOP-2)
166 LUSED = LQ(KQSP+LTOP-3)
167 LPURG = LQ(KQSP+LTOP-5)
168 LROUT = LQ(KQSP+LTOP-6)
169 LRIN = LQ(KQSP+LTOP-7)
170 LB = IQ(KQSP+LTOP+KLB)
171 LREC = IQ(KQSP+LTOP+LB+1)
172 LUN = IQ(KQSP+LTOP-5)
173 IZRECL = IQ(KQSP+LTOP+LB+1)
174 IMODEC = JBIT(IQ(KQSP+LTOP),5)
175 IMODEH = JBIT(IQ(KQSP+LTOP),6)
176 #if defined(CERNLIB_FQXISN)
178 * Set exchange mode bit
180 CALL SBIT1(IQ(KQSP+LTOP+KPW1+2),12)
183 #if !defined(CERNLIB_FQXISN)
184 IMODEX = JBIT(IQ(KQSP+LTOP+KPW1+2),12)
186 #if defined(CERNLIB_QMVAX)
187 IRELAT = JBIT(IQ(KQSP+LTOP),4)
189 IQUEST(7)=IQ(KQSP+LCDIR+KNKEYS)
190 IQUEST(8)=IQ(KQSP+LCDIR+KNWKEY)
191 IQUEST(9)=IQ(KQSP+LCDIR+KNSD)
192 IQUEST(10)=IQ(KQSP+LCDIR+KQUOTA)
195 IQUEST(13)=IQ(KQSP+LCDIR+KLK)
196 CALL RZDATE(IQ(KQSP+LCDIR+KDATEC),IDATEC,ITIMEC,1)
197 CALL RZDATE(IQ(KQSP+LCDIR+KDATEM),IDATEM,ITIMEM,1)
202 IQUEST(18)=IQ(KQSP+LCDIR+KRUSED)
203 IQUEST(19)=IQ(KQSP+LCDIR+KMEGA)
204 IQUEST(20)=IQ(KQSP+LCDIR+KWUSED)
205 IQUEST(21)=IQ(KQSP+LCDIR+IQ(KQSP+LCDIR+KLD))
209 IF(JBYT(IQ(KQSP+LCDIR+KPW1+2),6,5).NE.0)THEN
210 IF(IQ(KQSP+LCDIR+KPW1).NE.IHPWD(1).OR.
211 + IQ(KQSP+LCDIR+KPW1+1).NE.IHPWD(2))THEN
212 CALL SBIT1(IQ(KQSP+LCDIR),1)
214 CALL SBIT0(IQ(KQSP+LCDIR),1)
217 IF(JBIT(IQ(KQSP+LTOP),1).NE.0)CALL SBIT1(IQ(KQSP+LCDIR),1)