home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / ad109f66.zip / testupload.cmd < prev    next >
OS/2 REXX Batch file  |  1996-02-26  |  3KB  |  116 lines

  1. @echo off
  2. REM /////////////////////////////////////////////
  3. REM This is a sample TestUpload.Cmd for AdeptXBBS
  4. REM It does minimal _anything_ it shows how you
  5. REM might judge how to test a certain file. It
  6. REM does show you how to create the file which
  7. REM tells AdeptXBBS that an error occured
  8. REM /////////////////////////////////////////////
  9.  
  10. REM //////////////////////////////////////////
  11. REM Command line parms are as follows:
  12. REM %1 = Complete filename to work on
  13. REM %2 = Line number
  14. REM %3 = Com port file handle
  15. REM %4 = Just filename (no path, no extension)
  16. REM %5 = Just extension
  17. REM %6 = Just Drive:Path
  18. REM //////////////////////////////////////////
  19.  
  20. IF %5==ZIP GOTO ZIP
  21. IF %5==zip GOTO ZIP
  22. IF %5==LZH GOTO LZH
  23. IF %5==lzh GOTO LZH
  24. IF %5==ARC GOTO ARC
  25. IF %5==Arc GOTO ARC
  26. IF %5==RAR GOTO RAR
  27. IF %5==rar GOTO RAR
  28. IF %5==ARJ GOTO ARJ
  29. IF %5==arj GOTO ARJ
  30. IF %5==ZOO GOTO ZOO
  31. IF %5==zoo GOTO ZOO
  32.  
  33. REM /////////////////////////////////////////
  34. REM there is no method
  35. REM known which can test this file
  36. REM So we will just delete the error file
  37. REM should it exist for some one in a billion
  38. REM reason.... doesn't hurt.. does it?
  39. REM we could also skip to the virus scanning
  40. REM portion.. if any
  41. REM /////////////////////////////////////////
  42. DEL %4.%5.Error
  43. GOTO ENDHERE
  44.  
  45. :ZIP
  46. @echo on
  47. REM ////////////////
  48. REM Test a ZIP file
  49. REM ////////////////
  50. unzip -t %1
  51. @echo off
  52. IF ERRORLEVEL 1 GOTO Error
  53. GOTO NoError
  54.  
  55. :LZH
  56. REM ////////////////
  57. REM Test a LZH file
  58. REM ////////////////
  59. LH T %1
  60. IF ERRORLEVEL 1 GOTO Error
  61. GOTO NoError
  62.  
  63. :ARC
  64. REM ////////////////
  65. REM Test a ARC file
  66. REM ////////////////
  67. arc t %1
  68. IF ERRORLEVEL 1 GOTO Error
  69. GOTO NoError
  70.  
  71. :RAR
  72. REM ////////////////
  73. REM Test a ARC file
  74. REM ////////////////
  75. rar t %1
  76. IF ERRORLEVEL 1 GOTO Error
  77. GOTO NoError
  78.  
  79. :ARJ
  80. REM ////////////////
  81. REM Test a ZIP file
  82. REM ////////////////
  83. UNARJ T %1
  84. IF ERRORLEVEL 1 GOTO Error
  85. GOTO NoError
  86.  
  87. :ZOO
  88. REM ////////////////
  89. REM Test a ZIP file
  90. REM ////////////////
  91. ZOO -test %1
  92. IF ERRORLEVEL 1 GOTO Error
  93. GOTO NoError
  94.  
  95. :Error
  96. REM ///////////////////////////////////
  97. REM Note: The word ERROR is echoed into
  98. REM the file. This is not a necessity.
  99. REM The file simply needs to exist.
  100. REM ///////////////////////////////////
  101. ECHO ERROR >%4.%5.Error
  102. EXIT
  103.  
  104. :NoError
  105. REM ///////////////////////////////////////
  106. REM at this point, the archive passed the
  107. REM error test, now you could test the
  108. REM file contents with a virus scanner,
  109. REM or any other test you might like.
  110. REM The sample takes the easy way out and
  111. REM exits.
  112. REM ///////////////////////////////////////
  113. GOTO ENDHERE
  114.  
  115. :ENDHERE
  116.