From 6367110c56d65ef45cd9419fcbe2661f50d363d5 Mon Sep 17 00:00:00 2001 From: Ward Wouts Date: Mon, 5 Aug 2002 21:15:02 +0000 Subject: [PATCH] kill the disappearing tempfile problem --- trunk/ripnews/ripnews.rb | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/trunk/ripnews/ripnews.rb b/trunk/ripnews/ripnews.rb index a03eeee..a2c5691 100755 --- a/trunk/ripnews/ripnews.rb +++ b/trunk/ripnews/ripnews.rb @@ -32,10 +32,17 @@ def save_file(dir, name, data) case data.type.to_s when "String" - if File.rename(data, "#{dir}/#{newname}") - print " Saving as: '#{newname}'\n" - else - print "couldn't rename tempfile\n" + begin + if File.rename(data, "#{dir}/#{newname}") + print " Saving as: '#{newname}'\n" + else + print "couldn't rename tempfile\n" + return false + end + rescue Errno::ENOENT + print "Caught Errno::ENOENT (save_file)\n" + print "Error: #{$!}\n" + print "What the #@$$ happended?\n" return false end when "Array" @@ -246,7 +253,7 @@ def get_multi(subj, group) return false unless check_ext(filename, "m") body = fileout.path file.close - fileout.close + fileout.close(false) return mode, filename, body else print " Unknown encoding (not UU, not yEnc), skipping...\n"