catch weird error

This commit is contained in:
Ward Wouts 2005-06-20 07:29:14 +00:00
parent 700f0f6be4
commit 57a1062089

View file

@ -1,6 +1,6 @@
#!/usr/local/bin/ruby -w
#!/usr/bin/ruby -w
# $Dwarf: ripnews.rb,v 1.106 2005/05/18 21:52:51 ward Exp $
# $Dwarf: ripnews.rb,v 1.107 2005/06/06 12:53:10 ward Exp $
# $Source$
#
@ -112,6 +112,7 @@ def save_file(dir, name, data)
return false
end
when "Array"
begin
if file = File.new("#{dir}/#{newname}", "w", 0644)
print " Saving as: '#{newname}'\n"
data.collect{|i| file.print "#{i}"}
@ -119,6 +120,12 @@ def save_file(dir, name, data)
print "couldn't open file for writeing\n"
return false
end
rescue Errno::EINVAL
print "Caught Errno::EINVAL (save_file)\n"
print "Error: #{$!}\n"
print "What the *beep* happened?\n"
return false
end
when "Tempfile"
begin
if File.move(data.path, "#{dir}/#{newname}")