I’m trying to run the following program:
class XYZ
puts “Enter the file name you esnt to work with”
file_name = gets
input_file = File.open(file_name,‘r’)
output_file = File.open(‘output.txt’,‘w’)
for i in 1…1000
puts input_file.readline
end
end
But, get the following error:
xyz.rb:4:in initialize': Invalid argument - abc.txt (Errno::EINVAL) from xyz.rb:4:in
open’
from xyz.rb:4:in <class:XYZ>' from xyz.rb:1:in
’
Why is that? How can I solve this issue?>
Thanks.