1 | RGUTOS ;CAIRO/DKM - Platform-dependent operations;04-Sep-1998 11:26;DKM
|
---|
2 | ;;2.1;RUN TIME LIBRARY;;Mar 22, 1999
|
---|
3 | ;=================================================================
|
---|
4 | VER() Q $P($T(+2),";",3)
|
---|
5 | CVTFN(RGFIL,RGROOT) ;
|
---|
6 | N RGZ,RGZ1,RGD
|
---|
7 | S RGD=$$DIRDLM,RGROOT=$G(RGROOT)
|
---|
8 | S:$E(RGROOT,$L(RGROOT))=$E(RGD,3) RGROOT=$E(RGROOT,1,$L(RGROOT)-1)
|
---|
9 | S RGZ=$L(RGFIL,"/"),RGZ1=$P(RGFIL,"/",1,RGZ-1),RGFIL=$P(RGFIL,"/",RGZ)
|
---|
10 | S:$L(RGZ1) RGROOT=RGROOT_$E(RGD,$S($L(RGROOT):2,1:1))_$TR(RGZ1,"/.-",$E(RGD,2))
|
---|
11 | Q RGROOT_$S($L(RGROOT):$E(RGD,3),1:"")_RGFIL
|
---|
12 | RM(X) X ^%ZOSF("RM")
|
---|
13 | Q
|
---|
14 | TEST(X) N Z
|
---|
15 | S:X[U Z=$P(X,U),X=$P(X,U,2)
|
---|
16 | X ^%ZOSF("TEST")
|
---|
17 | Q $S('$T:0,$G(Z)="":1,Z'?.1"%"1.AN:0,1:$T(@Z^@X)'="")
|
---|
18 | ETRAP() Q $$NEWERR^%ZTER
|
---|
19 | OPENX(X1,X2) ;
|
---|
20 | D OPEN(.X1,.X2)
|
---|
21 | Q X1
|
---|
22 | OPEN(X1,X2) ;
|
---|
23 | O X1:$S("Rr"[$G(X2):"RS","Ww"[X2:"WNS","Bb"[X2:"RF",1:""):0
|
---|
24 | E ZT "NOPEN"
|
---|
25 | U X1
|
---|
26 | S ^TMP("HFS",$J,X1)=""
|
---|
27 | Q
|
---|
28 | CLOSE(X) C X
|
---|
29 | K ^TMP("HFS",$J,X)
|
---|
30 | Q
|
---|
31 | CLOSEALL N Z
|
---|
32 | S Z=""
|
---|
33 | F S Z=$O(^TMP("HFS",$J,Z)) Q:Z="" C Z
|
---|
34 | K ^TMP("HFS",$J)
|
---|
35 | Q
|
---|
36 | EOF ZT:$ZA=-1 "ENDOFFILE"
|
---|
37 | Q
|
---|
38 | EOFERR() Q:$ZE["ENDOFFILE"
|
---|
39 | READ(X,Y) ;
|
---|
40 | S $ZT="READX"
|
---|
41 | U $G(Y,$I)
|
---|
42 | R X
|
---|
43 | Q 0
|
---|
44 | READX Q 1
|
---|
45 | DELETE(X) ;
|
---|
46 | S X=$ZF(-1,"del """_X_"""")
|
---|
47 | Q
|
---|
48 | RENAME(X1,X2) ;
|
---|
49 | S X1=$ZF(-1,"ren """_X1_""" """_X2_"""")
|
---|
50 | Q
|
---|
51 | DIR(X1,X2,X3) ;
|
---|
52 | N Z,Z1
|
---|
53 | S X3=$G(X3,$NA(^UTILITY("DIR",$J)))
|
---|
54 | K @X3
|
---|
55 | S:'$G(X2) X2=9999999999
|
---|
56 | F Z=1:1:X2 S Z1=$ZSEARCH(X1),X1="" Q:Z1="" D
|
---|
57 | .S Z1=$P(Z1,"\",$L(Z1,"\"))
|
---|
58 | .S:$TR(Z1,".")'="" @X3@(Z1)=""
|
---|
59 | Q
|
---|
60 | DIRDLM() Q "\\\"
|
---|
61 | DEFDIR(X) ;
|
---|
62 | S X=$G(X,$P($G(^XTV(8989.3,1,"DEV")),U))
|
---|
63 | S:$E(X,$L(X))'="\" X=X_"\"
|
---|
64 | Q X
|
---|
65 | ERR(X1,X2,X3) ;
|
---|
66 | S X1=$E($P($ZE,">"),2,99),X2=$P($P($ZE,">",2),":"),X3=X1
|
---|
67 | S:X2["*" X2=""
|
---|
68 | S:$E(X1)="Z" X3=$E(X1,2,99),X1="ZTRAP"
|
---|
69 | Q
|
---|
70 | FTP(X1,X2,X3,X4,X5,X6,X7) ;
|
---|
71 | Q
|
---|
72 | RAISE(X) ZT $G(X)
|
---|
73 | TRAP(X) Q $S($D(X):"$ZT="""_X_"""",1:"$ZT")
|
---|
74 | SIZE(X) Q 0
|
---|
75 | FREE(X) Q 0
|
---|