source: FOIAVistA/trunk/r/KERNEL-XU-A4A7-USC-XG-XLF-XNOA-XPD-XQ-XVIR-ZI-ZOSF-ZOSV-ZT-ZU-%Z-XIP--XQAB--XUC--XUR--ZIN--ZTED/ZISFVXD.m@ 1582

Last change on this file since 1582 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 3.0 KB
Line 
1%ZISF ;SFISC/AC - HOST FILES (VAX DSM) ;06/02/2005 12:10
2 ;;8.0;KERNEL;**104,385**;JUL 10, 1995;Build 3
3HFS Q:$D(IOP)&$D(%IS("HFSIO"))&$D(%IS("IOPAR"))
4 ;Calling parameters in %ZIS override Device file.
5 N %
6 ;Get file name
7 I $D(%ZIS("HFSNAME")) S IO=%ZIS("HFSNAME"),%X=IO
8 E D ASKHFS
9 ;Mode or actual parameters
10H S:$D(%ZIS("HFSMODE")) %ZISOPAR=$$MODE(%ZIS("HFSMODE"))
11H1 I $D(IO("Q"))!(%IS["Z") S IO("HFSIO")=""
12 S %ZHFN=$S(%X]"":%X,1:IO),%ZHFN=$$CHKNM(%ZHFN),%XX=$&ZLIB.%PARSE(%ZHFN)
13 G H2:%XX["::"
14 I %XX]"",$&ZLIB.%GETDVI(%XX,"DEVCLASS")="DISK"
15 E S DUOUT=1,POP=1 W:'$D(IOP) !,"HOST FILE NAME NOT VALID" Q
16H2 S IO=$&ZLIB.%PARSE(%ZHFN,".DAT") I $D(IO("HFSIO")) S IO("HFSIO")=IO
17 W:'$D(IOP)&$D(%ZIS("HFSNAME")) " HOST FILE USED: "_IO,!
18 ;Check Ask Parameters
19 D ASKPAR^%ZIS6,SETPAR^%ZIS3
20 ;Mode or actual parameters
21HFSIOO Q:$D(%ZIS("HFSMODE"))
22 I '$D(IOP),%ZTYPE="HFS",'$P(^%ZIS(1,%E,0),"^",4),%ZISOPAR="",$P($G(^%ZIS(1,%E,1)),"^",6) W !,?20,"INPUT/OUTPUT OPERATION: R//"
23 Q:'$T D SBR^%ZIS1 I $D(DTOUT)!$D(DFOUT)!$D(DUOUT) S POP=1 Q
24 S:%X="" %X="R"
25 D HOPT:%X="?"!($F("?^R^N^RW",%X)'>1),HOPT1:%X="??"
26 G HFSIOO:%X="?"!($F("?^R^N^RW",%X)'>1)
27 S %ZISOPAR=$S(%X="R":"(READONLY)",%X="N":"(NEWVERSION)",1:"") Q
28 ;
29ASKHFS ;---Ask host file name here---
30 I $D(%IS("B","HFS"))#2,%IS("B","HFS")]"" D
31 .S IO=%IS("B","HFS") ;Set default host file name
32 S %X='$P($G(^%ZIS(1,%E,1)),"^",5)
33 S:'%X %X=""
34 I $D(IOP)!%X!$D(%ZIS("HFSNAME")) S %X="",%ZHFN=IO Q
35ASKAGN W !,"HOST FILE NAME: "_IO_"//" D SBR^%ZIS1
36 I %X?1."?".E W !,"ENTER HOST FILE NAME" G ASKAGN
37 S:$D(DTOUT)!$D(DUOUT) POP=1
38 Q
39ASKHFSIO(DA) ;Ask HFS Input/Output operation.
40 I %ZTYPE="HFS",'$P(^%ZIS(1,DA,0),"^",4),%ZISOPAR="",$P($G(^%ZIS(1,DA,1)),"^",6) Q 1
41 Q 0
42 ;
43CHKNM(H) ;Check HFS for dir
44 I (H'[":")&(H'["[") Q $$DEFDIR^%ZISH("")_H ;disk:[directory]file
45 Q H
46 ;
47MODE(X) ;Returns OPEN parameters in Y
48 N Y
49 S Y=$S(X["R"&(X["W"):"",X["A":"",X="R":"(READONLY)",X="W":"(NEWVERSION)",1:"(NEWVERSION)")
50 Q Y
51HOPT W !,"Enter one of the following host file input/ouput operation:"
52 W !,?16,"R = READONLY",!,?16,"N = NEWVERSION",!,?15,"RW = READ/WRITE",!
53 Q
54HOPT1 S %ZISI=$O(^DIC(9.2,"B","XUHFSPARAM-VXD",0)) Q:'%ZISI Q:'$D(^DIC(9.2,+%ZISI,0)) Q:$P(^(0),"^",1)'="XUHFSPARAM-VXD"
55 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)
56 W ! S %X="??"
57 Q
58 ;
59 ;--- OPEN/CLOSE EXECUTES, PRE-OPEN and POST-CLOSE EXECUTES FOR P-MESSAGE ---
60OEXPMSG Q ;Open Execute for p-message device
61CEXPMSG S XMREC="R X#255:1" U IO:DISCONNECT D ^XMAPHOST,READ^XMAPHOST K XMIO Q ;Close Execute for p-message device
62 Q
63POXPMSG Q ;Pre-open Execute for p-message device
64PCXPMSG Q ;Post-close Execute for p-message device
65 ;
66 ;--- OPEN/CLOSE EXECUTES, PRE-OPEN and POST-CLOSE EXECUTES FOR BROWSER DEVICE ---
67OEXDDBR D OPEN^DDBRZIS Q ;Open Execute for Browser device
68CEXDDBR D CLOSE^DDBRZIS Q ;Close Execute for Browser device
69POXDDBR I '$$TEST^DDBRT S %ZISQUIT=1 W $C(7),!,"Browser not selectable from current terminal.",! Q ;Pre-close Execute for Browser device
70PCXDDBR D POST^DDBRZIS Q ;Post-close Execute for Browser device
71 Q
Note: See TracBrowser for help on using the repository browser.