I\'m trying to create a new file and things don\'t seem to be working as I expect them too. Here\'s what I\'ve tried:
File.new \"out.txt\"
File.open \"out.tx
You can also use constants instead of strings to specify the mode you want. The benefit is if you make a typo in a constant name, your program will raise an runtime exception.
The constants are File::RDONLY or File::WRONLY or File::CREAT. You can also combine them if you like.
Full description of file open modes on ruby-doc.org