1
私はRailsでファイルストリームが開いているかどうかを確認することはできますか?
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
しかしf.openたい
f = File.new(contacts_file_path, "wb")
f.write params[:uploaded_file].read
f.close
がありますか?関数ではなく、私はAPIのドキュメントを見つけることができません。何か案は?