find_files (Daemons::PidFile)

    # File lib/daemons/pidfile.rb, line 36
        def PidFile.find_files(dir, progname, delete = false)
          files = Dir[File.join(dir, "#{progname}*.pid")]

          files.delete_if {|f| not (File.file?(f) and File.readable?(f))}
          if delete
            files.delete_if do |f|
              pid = File.open(f) {|h| h.read}.to_i
              rsl =  ! Pid.running?(pid)
              if rsl
                puts "pid-file for killed process #{pid} found (#{f}), deleting."
                begin; File.unlink(f); rescue ::Exception; end
              end
              rsl
            end
          end

          return files
        end