A
arose
I am trying to make a list of filenames in a txt file and have those
files generated.
g=File.open("Reader.txt","r")
g.each_line {|line| File.new(line.dump)}
I get an error message "Invalid argument - "ThisIsMyFileName.txt" which
is the first name in the Reader.txt file
and it points to the second line of my code above.
I try something similar like this
puts "What do you want to call your text file?"
newFileName=gets
g=File.open(newFileName,"w")
g.close()
I get an error "invalid Argument - whatever i type in"
If i try this though it works.
newFileName="Imadeafile"
g=File.open(newFileName,"w")
g.close()
I'm super new to Ruby, in fact this is my first program. What concept
am I missing here?
files generated.
g=File.open("Reader.txt","r")
g.each_line {|line| File.new(line.dump)}
I get an error message "Invalid argument - "ThisIsMyFileName.txt" which
is the first name in the Reader.txt file
and it points to the second line of my code above.
I try something similar like this
puts "What do you want to call your text file?"
newFileName=gets
g=File.open(newFileName,"w")
g.close()
I get an error "invalid Argument - whatever i type in"
If i try this though it works.
newFileName="Imadeafile"
g=File.open(newFileName,"w")
g.close()
I'm super new to Ruby, in fact this is my first program. What concept
am I missing here?