All
This is embarrassing:
How do I create a file?
construct the log file name. It does not exist as yet.
lfil = leg_dir+log_name
puts “Log file name is: #{lfil}”
Create the file
if !File.exists?(lfil)
puts “we entered file exixts condition”
begin
fOut = File.new(lfil, “w+”)
fOut.puts(“Thomas the Tank”)
rescue SystemCallError
puts “failed to create new file”
end
end
fOut.close unless fOut.nil?
I keep getting
jusplay.rb:15:in initialize': No such file or directory - D:/REINHARD/DEV/LOG/hello.log (Errno::ENOENT) from jusplay.rb:15:in
new’
from jusplay.rb:15
Thanks