str = File.open('rename.rb','w')
content = str.read
puts content
end
error at line 4
pls help
i'm a newbie
···
--
Posted via http://www.ruby-forum.com/.
str = File.open('rename.rb','w')
content = str.read
puts content
end
error at line 4
pls help
i'm a newbie
--
Posted via http://www.ruby-forum.com/.
kend means the Ruby keyword 'end'
$end means end of file.
Therefore this error means the your script has an extra keyword 'end' when one isn't required.
Henry
On 23/08/2012, at 10:50 AM, praveen k. wrote:
str = File.open('rename.rb','w')
content = str.read
puts content
enderror at line 4
pls help
i'm a newbie
I do not think you need the las line "end" and i thing you are not
opening the file for reading.
str = File.open('rename.rb')
content = str.read
puts content
it is going to display something only if the file has something in it.
--
Posted via http://www.ruby-forum.com/.