I have
f = File.new(contacts_file_path, "wb")
f.write params[:uploaded_file].read
f.close
I want
begin
f = File.new(contacts_file_path, "wb")
f.write params[:uploaded_file].read
rescue
#error
ensure
if f.open? then f.close end
end
But f.open? is not a function and I can't find any api documentation. Any ideas?