# this code is to list the directories def saggutenbergdirectories if $temp_rwdgutenberg_directory.to_s.empty? temp_dir = $rwdgutenberg_directory else temp_dir = $temp_rwdgutenberg_directory end @gutenberg_directory = temp_dir if FileTest.directory?(temp_dir) fileList = Dir.new(temp_dir).entries.sort.reverse.delete_if { |x| (x =~ /lnk$|nam$|htm$|html$|db$|jpg$|png$|exe$|sch$|rwd$|txt$/) } @noterecordsresult = "" @noterecordsresulth = "" @gutenbergdirectoriesresult = fileList.rwd_method("fillsaggutenbergdirs") end end def fillsaggutenbergdirs(inffile) applet = inffile if $temp_rwdgutenberg_directory.to_s.empty? temp_topdirectory = $rwdgutenberg_directory else temp_topdirectory = $temp_rwdgutenberg_directory end $temp_rwdgutenberg_directory = File.join(temp_topdirectory ,applet) @gutenberg_directory = temp_topdirectory end