I have ruby code which will create output file, currently file is creating at location from where my script is running. I have to write output file to different location so i am specifying explicit path into code. but it's not able to create file. my code looks like :
fname = "C:\repo\cookbooks\abc\recipes\add.rb"
somefile = File.open(fname,"w")
somefile.puts "end"
somefile.close
If i specify
fname = "add.rb"
it's working but i want to create it at different location as i mentioned above code in C:\ drive.