Alan Claughan
4/22/2009 7:54:00 PM
Oops that should be :
puts 'Enter Filename: '
$stdout.flush
filename = gets.chomp
inputfile = File.new(filename, 'r')
:-)
On 22 Apr 2009, at 9:49 PM, Alan Claughan wrote:
> Wow you seem to be a little confused her
>
> in line 1 you try to get a inputFile name from a print statement.
>
> You actually get the filename with line 3.
>
> line 4 is unnecessary as gets returns a string anyway.
>
> So you can do :
>
> puts 'Enter Filename: '
> $stdout.flush
> filename = gets.chomp
>
> inputfile = File.new(filename, 'w')
>
> Alan.
>
> On 22 Apr 2009, at 6:02 PM, Mmcolli00 Mom wrote:
>
>> inputFile = print("Enter Filename: ")
>> $stdout.flush
>> input = gets
>> myinput = input.to_s
>>
>> f = File.new(myinput) <-- in 'initialize': Invalid argument -
>> filename
>> (Errno::EINAL) from crb.rb in 'new'
>
>