Home / Programming MCQs / Ruby MCQs / Question

M

Mr. Dubey • 51.62K Points
Coach

Q. How do you open a file in Ruby in write mode, creating it if it does not exist?

(A) File.create("filename.txt", "w")
(B) File.write("filename.txt", "w")
(C) File.open("filename.txt", "w")
(D) File.new("filename.txt", "w")

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.