# this code is to delete update files def deleterwdscheduleupdatefiles # exception begin begin fileListarray = Dir.new($rwdschedule_updatedirectory).entries.sort.delete_if { |x| ! (x =~ /sch$/) } #loop through and get the files names fileListarray.each do |x| filetodelete = File.join($rwdschedule_updatedirectory,x) if File.exist?(filetodelete) File.delete(filetodelete) end end @rwdscheduleftpdisplay = "update files deleted" rescue @rwdscheduleftpdisplay = "error opening schedule update directory" end # end of error function end