home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Elysian Archive
/
AmigaElysianArchive.iso
/
comm
/
mkdiff12.lha
/
MakeR25Diff.rexx
< prev
Wrap
OS/2 REXX Batch file
|
1993-01-12
|
3KB
|
93 lines
/* MakeR25Diff.rexx v1.0 (12 Jan 1993)
*
* A small example add-on to the makediff utility to automatically
* make diff files for Region 25 Nodelists and export them
*
* usage: RX MakeR25Diff
*
* note that you need to unpack the archive to the correct directory
* before running the program.
*
* written by: Iain Hibbert @ 2:255/35.13
* Tony Jones @ 2:255/35
*/
/* customise this bit */
Dir = "T:" /* where to find and put the files */
Nodelist = "Region25" /* nodelist file stem to use */
DiffName = "R25Diff" /* diff file stem to use */
olddir = pragma('D',Dir)
/* find the most recent nodelist numbers.. */
files = showdir("",,'0A'x)
latest = 0
number = 0
do while files ~= ""
parse var files file '0A'x files
parse var file head '.' tail
if upper(Nodelist) == upper(head) then do
parse value statef(file) with . . . . day . . .
if day > latest then do
number = tail
latest = day
end
end
end
if number = 0 then do
say 'Sorry, no 'Nodelist' files found in 'Dir
end
else do
Archive = DiffName || '.' || 'L' || right(number,2,'0')
DiffName = DiffName || '.' || right(number,3,'0')
say 'Latest 'Nodelist' nodelist is 'number
if exists(DiffName) then say DiffName' already exists.'
else do
/* find last weeks nodelist file */
last = number - 7
if last < 0 then do
last = last + 365
if ~exists(Nodelist||'.'||right(last,3,'0')) then last=last+1
end
OldList = Nodelist || '.' || right(last,3,'0')
Nodelist = Nodelist || '.' || right(number,3,'0')
if ~exists(OldList) then say 'No 'OldList' to diff from.'
else do
writech(stdout, 'Making 'DiffName' .... ' )
address command 'makediff 'OldList Nodelist DiffName
say 'Done.'
/*
* after this, you can do whatever you want with the
* Diff file, it will be called DiffName in the Dir
* Directory.. the full file and pathname is:
*
* Dir || DiffName
*/
address command 'LhA a 'Archive DiffName
/*
* and now its called Dir || Archive
*/
/* you can upload it to the board automatically */
address command 'DLGProgs:DLGUpload -f '||Archive||' -a 20 -u MakeDiff -d "Region 25 NodeDiff for Day Number '||number
/* or you can send it out to the points that want it.. */
address command 'Fido:SendFile -OOut: -N2:255/35.10 -H '||Dir||Archive
address command 'Fido:SendFile -OOut: -N2:255/35.13 -H '||Dir||Archive
end
end
end
call pragma('D',olddir)
exit