Manually open and close a file.
# Using new method
f = File.new("test.txt", "r") # reading
f = File.new("test.txt", "w") # writing
f = File.new("test.txt", "a") # appending
# Using open method
f = open("test.txt", "r&...