source: hash/trunk/VWHSH3.m@ 1134

Last change on this file since 1134 was 684, checked in by John Leo Zimmer, 15 years ago

first commit from Glenwood

File size: 1.0 KB
Line 
1VWHSH3 ;;GpZ; - ; IMPROVED HASHING UTILITY: INSTALL MODULE, OpenM; 01/08/2010
2V ;;8.0;KERNEL;;Jul 10, 1995
3 ;
4 QUIT
5 ;
6INIT() S MUMPS=^%ZOSF("OS"),OS=$$OPENM("uname -o","Linux")
7 IF OS'["Linux" S OS=$$OPENM("Ver","Microsoft") DO
8 . S PIPE="PATH"
9 . OPEN PIPE:"Q" USE PIPE READ PATH CLOSE PIPE
10 . S PATH=PATH_";C:\""Program Files""\GNU\GnuPG\"
11 . F I=1:1:$L(PATH,";") Q:($P(PATH,";",I)["GnuPG")
12 . S PATH=$P(PATH,";",I)
13 ELSE S PATH=$P($P($$OPENM("whereis gpg","gpg")," ",2),"gpg")
14 S ZUT=$ZUTIL(68,40,1)
15 S PIPE=$G(PATH)_"gpg --version"
16 OPEN PIPE:"Q"
17 F I=1:1:20 USE PIPE R HASHLIST QUIT:$ZEOF<0 D:HASHLIST["'gpg' is not recognized" q:HASHLIST["Hash:"
18 . S HASHLIST="Hash:gpg_not_found:gpg_HASHES_not_available"
19 CLOSE PIPE
20 S ZUT=$ZUTIL(68,40,ZUT)
21 S HASHLIST=HASHLIST
22 S HASHLIST=$TR($P(HASHLIST,"Hash:",2),",")
23 S HASHLIST=HASHLIST_" ||"_PATH_"||"_MUMPS_OS_"||"
24 QUIT HASHLIST
25 ;
26OPENM(PIPE,SEEKING) ;;
27 N (PIPE,SEEKING)
28 S ZUT=$ZUTIL(68,40,1)
29 OPEN PIPE:"Q"
30 F I=1:1:4 USE PIPE READ X Q:$ZEOF<0 Q:X[SEEKING
31 CLOSE PIPE
32 S ZUT=$ZUTIL(68,40,ZUT)
33 QUIT X
Note: See TracBrowser for help on using the repository browser.