Index: FOIAVistA/tag/r/KERNEL-XU-A4A7-USC-XG-XLF-XNOA-XPD-XQ-XVIR-ZI-ZOSF-ZOSV-ZT-ZU-%Z-XIP--XQAB--XUC--XUR--ZIN--ZTED/ZISHONT.m
===================================================================
--- 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/ZISHONT.m	(revision 631)
+++ FOIAVistA/tag/r/KERNEL-XU-A4A7-USC-XG-XLF-XNOA-XPD-XQ-XVIR-ZI-ZOSF-ZOSV-ZT-ZU-%Z-XIP--XQAB--XUC--XUR--ZIN--ZTED/ZISHONT.m	(revision 636)
@@ -1,5 +1,5 @@
-%ZISH ;IHS/PR,SFISC/AC - Host File Control for Cache for VMS/NT/UNIX ;1/24/08  16:11
- ;;8.0;KERNEL;**34,65,84,104,191,306,385,440**;JUL 10, 1995;Build 13
- ;Per VHA Directive 2004-038, this routine should not be modified
+%ZISH ;IHS\PR,SFISC/AC - Host File Control for OpenM/Cache for NT/VMS ;12/13/2005
+ ;;8.0;KERNEL;**34,65,84,104,191,306,385**;JUL 10, 1995;Build 3
+ ;
  ; **MODIFIED VERSION FOR CACHE/VMS -- 9/7/01**
  ;
@@ -43,61 +43,26 @@
  Q 0
  ;
-DEL(%ZX1,%ZX2) ;ef,SR. Del files, return 1 if deleted all requested.
+DEL(%ZX1,%ZX2) ;ef,SR. Del fl(s)
  ;S Y=$$DEL^%ZISH("dir path",$NA(array))
- ; will invoke an OS command to delete file(s)
- ; UNIX: rm -f filespec[ ...]
- ; VMS: del filespec[,...]
- N %ZARG,%ZXDEL,%ZOS,%ZDELIM,%ZCOMND,%ZLIST
- S %ZARG="",%ZXDEL=1
- S %ZX1=$$DEFDIR($G(%ZX1))
- S %ZOS=$$OS^%ZOSV
- S %ZDELIM=$S(%ZOS="UNIX":" ",1:",")
- S %ZCOMND=$S(%ZOS="UNIX":"rm -f ",1:"del ")
- D
+ N %,%ZX,%ZXDEL,%ZISH,%ZOS
+ S %ZX1=$$DEFDIR($G(%ZX1)),%ZOS=$$OS^%ZOSV,%ZXDEL=1,%ZISH=""
+ F  S %ZISH=$O(@%ZX2@(%ZISH)) Q:%ZISH=""  D
  . N $ETRAP,$ESTACK S $ETRAP="D DELERR^%ZISH"
- . N %,%ZI,%ZISH,%ZX,%ZFOUND S %ZISH=""
- . F %ZI=1:1 S %ZISH=$O(@%ZX2@(%ZISH)) Q:%ZISH=""  D
- . . N $ETRAP,$ESTACK S $ETRAP="D DELERR^%ZISH"
- . . I %ZISH["*" S %ZXDEL=0 Q  ; Wild card not allowed.
- . . S %ZX=$S(%ZISH[%ZX1:%ZISH,1:%ZX1_%ZISH) ; prepend directory path
- . . I %ZOS="VMS",%ZX'[";" S %ZX=%ZX_";*"
- . . S %ZFOUND=$ZSEARCH(%ZX)]""  ; File exists
- . . S:%ZFOUND %ZARG=$S(%ZARG="":%ZX,1:%ZARG_%ZDELIM_%ZX) ; join files
- . . I $L(%ZARG)>2000 S %=$ZF(-1,%ZCOMND_%ZARG),%ZARG="" H 1 ; delete files at a time
- . ;
- . I $L(%ZARG) S %=$ZF(-1,%ZCOMND_%ZARG) ; delete remaining files
- ;
- I %ZXDEL S %ZXDEL='$$LIST(%ZX1,%ZX2,"%ZLIST")
+ . I %ZISH["*" S %ZXDEL=0 Q  ; Wild card not allowed.
+ . S %ZX=$S(%ZISH[%ZX1:%ZISH,1:%ZX1_%ZISH)
+ . I %ZOS="VMS",%ZX'[";" S %ZX=%ZX_";*"
+ . Q:$ZSEARCH(%ZX)']""  ; File doesn't exist
+ . S %=$ZF(-1,$S(%ZOS="UNIX":"rm ",1:"del ")_%ZX)
+ . I $ZSEARCH(%ZX)]"" S %ZXDEL=0 ; Delete was not successful.
  Q %ZXDEL
  ;
 DELERR ;Trap any $ETRAP error, unwind and return.
  S $ETRAP="D UNWIND^%ZTER"
- S %ZXDEL=0,%ZARG=""
+ S %ZXDEL=0
  D UNWIND^%ZTER
  Q
  ;
-DEL1(%ZX3) ;ef,SR. Delete one file
- N %ZI1,%ZI2
- D SPLIT(%ZX3,.%ZI1,.%ZI2) S %ZI2(%ZI2)=""
- Q $$DEL(%ZI1,$NA(%ZI2))
- ;
-SPLIT(%I,%O1,%O2) ;Split to path,file
- N %ZOS,%D,D S %ZOS=$$OS^%ZOSV
- I %ZOS["VMS" D  Q
- . S D=$S(%I["]":"]",1:":")
- . S %O1=$P(%I,D,1)_D,%O2=$P(%I,D,2)
- . Q
- S %D=$S(%ZOS="UNIX":"/",%ZOS="NT":"\",1:""),%O1="",%O2="" Q:%D=""
- S D=$L(%I,%D),%O1=$P(%I,%D,1,D-1),%O2=$P(%I,%D,D)
- Q
- ;
-FEXIST(%PATH,%FL) ;Check if files exsist.
- ;S Y=$$DTEST("/usr/var",$NA(array))
- N %ZISH,%ZISHY
- S %ZISH=$$LIST(%PATH,%FL,"%ZISHY")
- Q %ZISH
- ;
 LIST(%ZX1,%ZX2,%ZX3) ;ef,SR. Create a local array holding file names
- ;S Y=$$LIST^%ZISH("\dir\",$NA(array),$NA(return array)) Return 1 if found anything
+ ;S Y=$$LIST^ZOSHDOS("\dir\",$NA(array),$NA(return array)) Return 1 if found anything
  ;
  N %ZISH,%ZISHN,%ZX,%ZISHY,%ZY,%ZOS
@@ -110,5 +75,5 @@
  . ;NT, display case, ignore for lookup
  . S %ZX=%ZX1_%ZISH
- . F %ZISHN=0:1 D  Q:(%ZX="")
+ . F %ZISHN=0:1 D  Q:(%ZX="") 
  . . S %ZX=$ZSEARCH($S(%ZISHN:"",1:%ZX))
  . . ;Q:(%ZX="")!($$UP^XLFSTR(%ZX)'[%ZISHY)!(%ZX?.E1.2".")
@@ -161,5 +126,5 @@
  N %ZOS,P1,P2 S %ZOS=$$OS^%ZOSV,DF=$G(DF)
  Q:DF="." "" ;Special way to get current dir.
- S:DF="" DF=$G(^XTV(8989.3,1,"DEV")),DF=$P(DF,"^",$S($$PRI^%ZOSV<2:1,1:2))
+ S:DF="" DF=$G(^XTV(8989.3,1,"DEV"))
  Q:DF="" ""
  ;Check syntax, VMS needs disk:[dir] or logical:
@@ -171,10 +136,10 @@
  . S DF=P1_P2 S:DF'[":" DF=DF_":"
  . Q
- ;Check syntax, Unix needs /mnt/fl, ./fl, ~/fl $HOME/fl
+ ;Check syntax, Unix needs /mnt/fl, ./fl
  I %ZOS="UNIX" D
  . S DF=$TR(DF,"\","/")
  . S:$E(DF,$L(DF))'="/" DF=DF_"/"
  . Q
- ;Check syntax, NT needs c:\dir\
+ ;Check syntax, NT needs c:\dir\ 
  I %ZOS="NT" D
  . N P1,P2
@@ -227,5 +192,5 @@
  ;
 FTG(%ZX1,%ZX2,%ZX3,%ZX4,%ZX5) ;ef,SR. Unload contents of host file into global
- ;p1=hostf file directory
+ ;p1=hostf file directory 
  ;p2=host file name
  ;p3= $NAME REFERENCE INCLUDING STARTING SUBSCRIPT
