I have been using a open source program called curl to keep my Vista
software up to date.
The following information gives information regarding downloading and
installing curl. I have also included the Cache version of the mumps
routine that I use. It monitors the VA FIOA ftp server getting a directory
listing of the Package directory and then each individual package directory.
When a new update is loaded on the ftp server, this routine will
automatically download the patch and place it in a directory for me to
manually install.
I have commented out the actual final download code, because the first time
that you run the code it will try to download everything in all the package
directories. You should uncomment out the final download code after the
first time you run the routine.
..;S STATUS=$ZF(-1,SYSSTR)
You would also want to kill the global listing of NEW files: K ^FIOA("NEW")
This will start from this point and move forward.
http://curl.haxx.se/
Curl is a command line tool for transferring files with URL syntax,
supporting FTP, FTPS, HTTP, HTTPS, GOPHER, TELNET, DICT, FILE and LDAP. Curl
supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading, kerberos,
HTTP form based upload, proxies, cookies, user+password authentication, file
transfer resume, http proxy tunneling and a busload of other useful tricks.
FIOA ;ROUTINE TO OBTAIN A DIRECTORY OF THE FIOA RELEASES.
;
; Get the directory of Packages.
S SYSSTR="curl -m 60 -o c:\temp\fioa.dir
ftp://ftp.va.gov/vista/Software/Packages/"
S STATUS=$ZF(-1,SYSSTR)
;
; Quit if download didn't work.
S EXISTS=##class(%File).Exists("c:\temp\fioa.dir") G:'EXISTS END
;
; Add a few blank lines to the bottom of the file.
S OUTFILE="c:\temp\fioa.dir"
OPEN OUTFILE:"AWS":2
U OUTFILE W !!!
CLOSE OUTFILE
;
; Open the directory of Packages and write the data to a global.
S INFILE="c:\temp\fioa.dir" OPEN INFILE::2 G:$T=0 END
K ^FIOA("DIRTEMP")
F D Q:ONELINE=""
.U INFILE R ONELINE Q:ONELINE=""
.S ^FIOA("PACKAGES",$E(ONELINE,56,$L(ONELINE)))=""
.S ^FIOA("DIRTEMP",$E(ONELINE,56,$L(ONELINE)))=""
CLOSE INFILE
;
; Work through the DIRTEMP global and get each individual package
directory.
S ZS2="" F X=1:1 S ZS2=$O(^FIOA("DIRTEMP",ZS2)) Q:ZS2="" D
.W ZS2,!
.S SYSSTR="curl -m 60 -o c:\temp\fioa1.dir
ftp://ftp.va.gov/vista/Software/Packages/"""_ZS2_"""/"
.S STATUS=$ZF(-1,SYSSTR)
.;
.; Quit if download didn't work.
.S EXISTS=##class(%File).Exists("c:\temp\fioa1.dir") Q:'EXISTS
.;
.; Add a few blank lines to the bottom of the file.
.S OUTFILE="c:\temp\fioa1.dir"
.OPEN OUTFILE:"AWS":2
.U OUTFILE W !!!
.CLOSE OUTFILE
.;
.; Open the individual package directory file add the files to the
package list.
.; If adding a new file, also add it to the "NEW" list for later
download.
.S INFILE="c:\temp\fioa1.dir" OPEN INFILE::2 G:$T=0 END
.F D Q:ONELINE=""
..U INFILE R ONELINE Q:ONELINE=""
..S:$D(^FIOA("PACKAGES",ZS2,$E(ONELINE,56,$L(ONELINE))))=0
^FIOA("NEW",ZS2,$E(ONELINE,56,$L(ONELINE)))=""
..S ^FIOA("PACKAGES",ZS2,$E(ONELINE,56,$L(ONELINE)))=""
.CLOSE INFILE
.S EXISTS=##class(%File).Delete("c:\temp\fioa1.dir")
;
; Work through the "NEW" file list and download the new files.
S ZS1="NEW",ZS2="" F S ZS2=$O(^FIOA(ZS1,ZS2)) Q:ZS2="" D
.S ZS3="" F S ZS3=$O(^FIOA(ZS1,ZS2,ZS3)) Q:ZS3="" D
..S SYSSTR="curl -m 60 -o C:\CacheSys\Mgr\Vista\Patches\"_ZS3_"
ftp://ftp.va.gov/vista/Software/Packages/"""_ZS2_"""/"_ZS3
..;S STATUS=$ZF(-1,SYSSTR)
..S
EXISTS=##class(%File).Exists("C:\CacheSys\Mgr\Vista\Patches\"_ZS3)
..I EXISTS K ^FIOA("NEW",ZS2,ZS3)
;
Q
;
END ;Clean Up and end routine
;
K ^FIOA("DIRTEMP")
S STATUS=##class(%File).Delete("c:\temp\fioa.dir")
S STATUS=##class(%File).Delete("c:\temp\fioa1.dir")
;
Q
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Hardhats-members mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hardhats-members