home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 35 Internet
/
35-Internet.zip
/
timezn_c.zip
/
TIMEZONE.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1996-04-29
|
5KB
|
115 lines
/* TimeZone3.cmd */
/* Off-line Time/Date Stamp Modifyer for MR/2 ICE */
/* William H. Geiger III */
/* Geiger Consulting */
/* whgiii@amaranth.com */
say time()
month_of_year="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec"
user_name=''
fix=''
parse arg user_name fix
if fix=='' then do
st=stream('error.log','c','open')
st=stream('error.log','c','close')
'@echo off'
erase error.log
pause
end /* Do */
inbox2=user_name||"\mr2i.ndx"
st=stream(inbox2,'c','open')
do forever while lines(inbox2)
nxx=stream(inbox2,'c','seek+0')
ln1=linein(inbox2)
w1=substr(ln1,28,8)
w2=substr(ln1,37,3)
w3=substr(ln1,41,11)
w4=substr(ln1,54,8)
w5=substr(ln1,63,5)
w6=substr(ln1,78,1)
w7=substr(ln1,84)
file_name=user_name||"\"||w1||"."||w2
if fix=='fix' then call 'tzfix.cmd' file_name
else call 'tz1.cmd' file_name
x6=stream(file_name,'c','open')
old=0
fixed=0
nyx=1
do forever while (length(linein(file_name))>0) /* pull info from file header */
nzx=stream(file_name,'c','seek =' nyx)
linx=linein(file_name)
nyx=stream(file_name,'c','seek +0')
xx1=pos('Date:',linx,1)
xx2=pos('Old TimeStamp:',linx,1)
xx3=pos('Fixed:',linx,1)
if xx1>0 then dt=linx
if xx2>0 then old=1
if xx2>0 then fixed=1
end
x6=stream(file_name,'c','close')
if (fix=='fix' & fixed=0) then iterate
else if old=0 then iterate
parse value dt with xx5 dowt date mont yr tm tz tzt
mon=wordpos(mont,month_of_year) /* convert month to # */
if length(mon)=1 then mon='0'||mon
if length(yr)=4 then yr=right(yr,2)
d1=yr||'/'||mon||'/'||date
t1=substr(tm,1,5)
y8=' '||w1 w2 w3||' '||d1 t1||' '||w6||' '||w7
nxy=stream(inbox2,'c','seek =' nxx)
call lineout inbox2,y8
end
st=stream(inbox2,'c','close')
y4=user_name||'\folders.ndx'
x4=stream(y4,'c','open')
do forever while lines(y4)
y5=linein(y4)
parse value y5 with v1 '' v2 '' v3 '' v4 '' v5 /* get folder name */
folder=user_name||'\'||v3||'\folder.ndx'
say folder
x5=stream(folder,'c','open') /* open folder index */
do forever while lines(folder)
nxx=stream(folder,'c','seek+0')
ln1=linein(folder)
w1=substr(ln1,28,8)
w2=substr(ln1,37,3)
w3=substr(ln1,41,11)
w4=substr(ln1,54,8)
w5=substr(ln1,63,5)
w6=substr(ln1,78,1)
w7=substr(ln1,84)
file_name=user_name||"\"||v3||"\"||w1||"."||w2
if fix='fix' then call tzfix.cmd file_name
else call 'tz1.cmd' file_name
x6=stream(file_name,'c','open')
old=0
fixed=0
nyx=1
do forever while (length(linein(file_name))>0) /* pull info from file header */
nzx=stream(file_name,'c','seek =' nyx)
linx=linein(file_name)
nyx=stream(file_name,'c','seek +0')
xx1=pos('Date:',linx,1)
xx2=pos('Old TimeStamp:',linx,1)
xx3=pos('Fixed:',linx,1)
if xx1>0 then dt=linx
if xx2>0 then old=1
if xx3>0 then fixed=1
end
x6=stream(file_name,'c','close')
if (fix=='fix' & fixed=0) then iterate
else if old=0 then iterate
parse value dt with xx5 dowt date mont yr tm tz tzt
mon=wordpos(mont,month_of_year) /* convert month to # */
if length(mon)=1 then mon='0'||mon
if length(yr)=4 then yr=right(yr,2)
d1=yr||'/'||mon||'/'||date
t1=substr(tm,1,5)
y8=' '||w1 w2 w3||' '||d1 t1||' '||w6||' '||w7
nxy=stream(folder,'c','seek =' nxx)
call lineout folder,y8
end
x5=stream(folder,'c','close')
end
x4=stream(y4,'c','close')
say time()