home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / imm_110.zip / DOTICK.CMD < prev    next >
OS/2 REXX Batch file  |  1994-11-18  |  4KB  |  116 lines

  1. /* TIC processing */
  2.  
  3.  
  4. /**************************************************************
  5.  * Load the REXX Utility Functions (RexxUtil)
  6.  **************************************************************
  7.  */
  8. CALL RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  9. CALL SysLoadFuncs
  10.  
  11. /**************************************************************
  12.  * load shareware dll for resource locking function.
  13.  **************************************************************
  14.  */
  15. If RxFuncQuery('RxExtra') <> 0 Then
  16.     ry = RxFuncAdd('RxExtra', 'RxExtras', 'RxExtra')
  17.  
  18. CALL RxExtra "Drop" /* Drop everything */
  19. rc = RxFuncAdd('RxExtra', 'RxExtras', 'RxExtra')
  20. CALL RxExtra "Load"
  21.  
  22.    OS2ENV = "OS2ENVIRONMENT"
  23.  
  24.    Dir_Tick     = Value('tick',,OS2ENV)
  25.    Dir_MailProc = Value('mailproc',,OS2ENV)
  26.    Dir_NodeList = Value('nodelist',,OS2ENV)
  27.    Dir_Binkley  = Value('binkley',,OS2ENV)
  28.    Dir_Max      = Value('max',,OS2ENV)
  29.  
  30.    CurDir = Directory()
  31.  
  32. /**************************************************************
  33.  * before we start make sure no one else is messing around
  34.  * with mail and the outbound FLO files.  to this we obtain
  35.  * a system resource.  any other mail processes must also follow
  36.  * this same technique to avoid corrupting files by walking on
  37.  * each other
  38.  **************************************************************
  39.  */
  40. Say 'Waiting for TicLock...'
  41.  
  42. DO UNTIL DATATYPE(hmaillock) = 'NUM'
  43.     hmaillock = RxResourceCreate('TicLock')
  44.     IF RxResourceRequest('TicLock') = 'Resource available' THEN
  45.         LEAVE
  46. END
  47.  
  48. /**************************************************************
  49.  * Check for any received files that require additional
  50.  * processing
  51.  **************************************************************
  52.  */
  53.    Call SysFileTree "C:\Binkley\Inbound\NodeDiff.A??", NodeDiff, 'F'
  54.    Call SysFileTree "C:\Binkley\Inbound\Fnews*.*", Fnews, 'F'
  55.    Call SysFileTree "C:\Binkley\Inbound\IbmList.Z??", IbmList, 'F'
  56.  
  57. /**************************************************************
  58.  * run the tic processor
  59.  *
  60.  * if nef was successful, update the max available files
  61.  * index
  62.  **************************************************************
  63.  */
  64.    rq = Directory(Dir_Tick) ;
  65.    Nef
  66.  
  67.    If rc = 0 Then Do
  68.        "Echo > C:\Binkley\Flags\BtReScan.01"
  69.        "Echo > C:\Binkley\Flags\BtReScan.02"
  70.        rq = Directory(Dir_Max)
  71.        fbp
  72.    End
  73.  
  74. /**************************************************************
  75.  * If a nodediff or the fido news was received, update binkleys
  76.  * okfile.lst
  77.  **************************************************************
  78.  */
  79.    If Fnews.0 \= 0 Then Do
  80.        rq = Directory(Dir_Binkley)
  81.        "Flm -cflmokfil.cfg"
  82.    End
  83.  
  84. /**************************************************************
  85.  * if a nodediff was received, we'll go ahead and compile
  86.  * the new list.  when we are done, we'll tell binkley about
  87.  * it so he can copy it to his area.
  88.  **************************************************************
  89.  */
  90.    If NodeDiff.0 \= 0 | IbmList.0 \= 0 Then Do
  91.        rq = Directory(Dir_NodeList)
  92.  
  93.        If NodeDiff.0 \= 0 Then Do
  94.           "Del D:\NodeList\Old\Node*.*"
  95.           "Copy D:\NodeList\Current D:\NodeList\Old"
  96.           "Del D:\NodeList\Current\Node*.*"
  97.           "DayNbr /d5 /+0 Copy D:\NodeDiff\NodeDiff.@A## D:\NodeList\Current "
  98.           "DayNbr /d5 /+0 Arc2 X D:\NodeDiff\NodeDiff.@A##"
  99.        End
  100.  
  101.        If IbmList.0 \= 0 Then Do
  102.           "DayNbr /d5 /+0 Unzip D:\IbmNet\IbmNet\IbmList.@Z##"
  103.        End
  104.  
  105.        FastLstp
  106.        rq = Directory(Dir_Binkley)
  107.        "Flm -cflmokfil.cfg"
  108.    End
  109.  
  110.  
  111. EndIt:
  112.    CALL RxResourceRelease 'TicLock'
  113.    rq = Directory(CurDir)
  114.    "exit"
  115.  
  116.