I’m trying to write to a new file, wich I’m creating by
This works fine so far, the file is created in my working folder and
contains the text I’m putting in.
Now I want the user to input the filename, so I modified my source code
print "Please insert file name: "
Running the Programm and inputting ‘test’ (without the ‘’), I get the
initialize': Invalid argument - test (Errno::EINVAL) .txt from ..\rubyfile.rb:116:innew’
I have no idea, what’s going wrong… Since file_name is a string,
file_name+’.txt’ ought to be a string too, and thus a valid argument for
the initializer method of File, or not?
Sorry, if my question is dumb, I’m a total noob with ruby…
Thanks for any help!