[613] | 1 | %ZISF ;SFISC/AC - HOST FILE CODE FOR MSM ;05/07/98 10:56
|
---|
| 2 | ;;8.0;KERNEL;**104**;JUL 10, 1995
|
---|
| 3 | HFS Q:$D(IOP)&$D(%IS("HFSIO"))&$D(%IS("IOPAR"))
|
---|
| 4 | I $D(%ZIS("HFSNAME")) D Q:$D(%ZIS("HFSMODE"))
|
---|
| 5 | .I $D(%ZIS("HFSMODE")) D
|
---|
| 6 | ..S %ZISOPAR=$$MODE^%ZISF(%ZIS("HFSNAME"),%ZIS("HFSMODE"))
|
---|
| 7 | ..W:'$D(IOP) " HOST FILE TO USE: "_%ZIS("HFSNAME") Q
|
---|
| 8 | .S %X=%ZIS("HFSNAME") D SETOPAR
|
---|
| 9 | .W:'$D(IOP) " HOST FILE TO USE: "_%ZIS("HFSNAME"),! Q
|
---|
| 10 | E D ASKHFS ;Note the HFS name is part of the IO parameter string
|
---|
| 11 | H S:$D(%ZIS("HFSMODE")) %ZISOPAR=$$MODE^%ZISF(%X,%ZIS("HFSMODE"))
|
---|
| 12 | H1 S:$D(IO("Q"))!(%IS["Z") IO("HFSIO")=""
|
---|
| 13 | S:$E(%ZISOPAR)'="(" %ZISOPAR="("""_%ZISOPAR_""":""W"")"
|
---|
| 14 | S:$D(IO("HFSIO")) IO("HFSIO")=IO
|
---|
| 15 | D ASKPAR^%ZIS6,SETPAR^%ZIS3 K %ZY
|
---|
| 16 | HFSIOO Q:$D(%ZIS("HFSMODE"))
|
---|
| 17 | I '$D(IOP),$$ASKHFSIO(%E) W ?45,"INPUT/OUTPUT OPERATION: "
|
---|
| 18 | Q:'$T D SBR^%ZIS1 I $D(DTOUT)!$D(DFOUT)!$D(DUOUT) S POP=1 Q
|
---|
| 19 | D HOPT(1):%X="?"!($F("?^R^W^M^A",%X)'>1),HOPT1:%X="??" G HFSIOO:%X="?"!($F("?^R^W^M^A",%X)'>1)
|
---|
| 20 | S $P(%ZISOPAR,"""",4)=%X Q
|
---|
| 21 | ;
|
---|
| 22 | HOPT(X) ;Display Input/Output operation -- X=1 for scroll, X=2 for MWAPI.
|
---|
| 23 | I X=1 D
|
---|
| 24 | .W !,"Enter one of the following host file input/ouput operation:"
|
---|
| 25 | .W !,?16,"R = READ",!,?16,"W = WRITE",!,?16,"M = READ/WRITE",!,?16,"A = APPEND" Q
|
---|
| 26 | E D
|
---|
| 27 | .K TMP("ZISGHFS","G","HFSOPER","CHOICE")
|
---|
| 28 | .S TMP("ZISGHFS","G","HFSOPER","CHOICE","1^R")="READ"
|
---|
| 29 | .S TMP("ZISGHFS","G","HFSOPER","CHOICE","2^W")="WRITE"
|
---|
| 30 | .S TMP("ZISGHFS","G","HFSOPER","CHOICE","3^M")="READ/WRITE"
|
---|
| 31 | .S TMP("ZISGHFS","G","HFSOPER","CHOICE","4^A")="APPEND"
|
---|
| 32 | Q
|
---|
| 33 | HOPT1 S %ZISI=$O(^DIC(9.2,"B","XUHFSPARAM-MSM",0)) Q:'%ZISI Q:'$D(^DIC(9.2,+%ZISI,0)) Q:$P(^(0),"^",1)'="XUHFSPARAM-MSM"
|
---|
| 34 | Q:$D(^DIC(9.2,+%ZISI,1))'>9 F %X=0:0 S %X=$O(^DIC(9.2,+%ZISI,1,%X)) Q:%X'>0 I $D(^(%X,0)) W !,^(0)
|
---|
| 35 | W ! S %X="??" Q
|
---|
| 36 | ;
|
---|
| 37 | CHKNM(H) ;Check HFS name for dir
|
---|
| 38 | I $$OSTYPE^%ZOSV<3 S H=$TR(H,"/","\") ;for DOS/NT only
|
---|
| 39 | I H[":"!(H["\")!(H["/") Q H
|
---|
| 40 | Q $$DEFDIR^%ZISH("")_H
|
---|
| 41 | ;
|
---|
| 42 | ASKHFS ;---Ask host file name here---
|
---|
| 43 | S %X='$P($G(^%ZIS(1,%E,1)),"^",5)
|
---|
| 44 | S:'%X %X=""
|
---|
| 45 | Q:$D(IOP)!%X!$D(%ZIS("HFSNAME"))
|
---|
| 46 | ASKAGN W !,"HOST FILE NAME: " S %ZY=$$GETHFSNM(%ZISOPAR)
|
---|
| 47 | W:%ZY]"" %ZY_"//" D SBR^%ZIS1
|
---|
| 48 | I %X?1."?".E W !,"ENTER HOST FILE NAME" G ASKAGN
|
---|
| 49 | I $D(DTOUT)!$D(DUOUT) K %ZY S POP=1 Q
|
---|
| 50 | S %X=$S(%X]"":%X,1:%ZY)
|
---|
| 51 | I %X="" W *7,!,"You must enter the name of a host file" G ASKAGN
|
---|
| 52 | D SETOPAR Q
|
---|
| 53 | ;
|
---|
| 54 | SETOPAR ;Set the file name into %ZISOPAR
|
---|
| 55 | S %X=$$CHKNM(%X)
|
---|
| 56 | I %ZISOPAR?1"("1"""".ANP1""""1":"1"""".AN1""""1")" S $P(%ZISOPAR,"""",2)=%X Q
|
---|
| 57 | S %ZISOPAR=%X
|
---|
| 58 | Q
|
---|
| 59 | MODE(X1,X2) ;Return value in Y
|
---|
| 60 | N Y
|
---|
| 61 | S Y="("_""""_X1_""":"_""""_$S(X2="RW":"M",X2="R":"R",X2="W":"W",X2="A":"A",1:"W")_""")"
|
---|
| 62 | Q Y
|
---|
| 63 | ASKHFSIO(DA) ;
|
---|
| 64 | I $G(^%ZIS(1,DA,"TYPE"))="HFS",'$D(%ZIS("HFSMODE")),'$P(^(0),"^",4),$P($G(^(1)),"^",6) Q 1
|
---|
| 65 | Q 0
|
---|
| 66 | GETHFSNM(X) ;Extract host file name from variable X.
|
---|
| 67 | N Y
|
---|
| 68 | S Y=X
|
---|
| 69 | S:Y?1"("1"""".ANP1""""1":"1"""".AN1""""1")" Y=$P(Y,"""",2)
|
---|
| 70 | I $D(%IS("B","HFS"))#2,%IS("B","HFS")]"" S Y=%IS("B","HFS")
|
---|
| 71 | Q Y
|
---|