home *** CD-ROM | disk | FTP | other *** search
- /* Rexx */
- /**************************************************************************/
- /* Pass the files selected in Directory Opus through Virus Checker */
- /**************************************************************************/
- trace off
- options results
- arg source_dir
-
- address 'dopus_rexx'
- 'busy on'
- 'status 3'; active_window=result
- suspect_virus='no'
- call virus_check_selected_files(source_dir)
-
- exit:
- address 'dopus_rexx'
- 'status 13' active_window 'set' source_dir
- if suspect_virus='no' then 'toptext Virus Checker reports no viruses'
- else 'toptext ALERT - Viruses found'
- 'busy off'
- return
-
- /**************************************************************************/
- /* check all selected files and directories */
- virus_check_selected_files: procedure expose active_window suspect_virus
- arg this_dir
- selected_files=''
- address 'dopus_rexx'
- 'getselectedfiles'
- if result~='RESULT' then selected_files=result
- do while words(selected_files)~=0
- parse var selected_files fnam selected_files
- address 'Virus_Checker'; 'checkfile\'this_dir||fnam
- if result~='RESULT' then call virus_checker_failed(fnam)
- address 'dopus_rexx'; 'selectfile' fnam '0 1'
- end /* do */
- /**************************************************************************/
- /* Recursively check each selected dir */
- selected_dirs=''
- address 'dopus_rexx'
- 'getselecteddirs'
- if result~='RESULT' then selected_dirs=result
- do while words(selected_dirs)~=0
- parse var selected_dirs next_dir selected_dirs
- address 'dopus_rexx'
- 'status 13' active_window 'set' this_dir||next_dir'/'
- 'all'; 'busy on'
- call virus_check_selected_files(this_dir||next_dir'/')
- end /* do */
- return
-
- /**************************************************************************/
- /* Virus Checker failed this one */
- virus_checker_failed:
- suspect_virus='yes'
- address 'dopus_rexx'
- 'request' fnam 'failed' result'. Continue?'
- if rc=0 then signal exit
- return
-
-