kill the disappearing tempfile problem
This commit is contained in:
parent
81acfe4397
commit
6367110c56
1 changed files with 12 additions and 5 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue