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
|
case data.type.to_s
|
||||||
when "String"
|
when "String"
|
||||||
if File.rename(data, "#{dir}/#{newname}")
|
begin
|
||||||
print " Saving as: '#{newname}'\n"
|
if File.rename(data, "#{dir}/#{newname}")
|
||||||
else
|
print " Saving as: '#{newname}'\n"
|
||||||
print "couldn't rename tempfile\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
|
return false
|
||||||
end
|
end
|
||||||
when "Array"
|
when "Array"
|
||||||
|
|
@ -246,7 +253,7 @@ def get_multi(subj, group)
|
||||||
return false unless check_ext(filename, "m")
|
return false unless check_ext(filename, "m")
|
||||||
body = fileout.path
|
body = fileout.path
|
||||||
file.close
|
file.close
|
||||||
fileout.close
|
fileout.close(false)
|
||||||
return mode, filename, body
|
return mode, filename, body
|
||||||
else
|
else
|
||||||
print " Unknown encoding (not UU, not yEnc), skipping...\n"
|
print " Unknown encoding (not UU, not yEnc), skipping...\n"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue