ruby - File Shows error -
while inserting content file:
file1=file.new("output.txt","w+") puts "enter string" in1=gets.chomp if file1 file1.syswrite() else puts cant write end file1.close
try this, uses write
method on file class. remember when you're writing puts statement, succeeding string needs in quotes.
file1=file.new("output.txt","w+") puts "enter string" in1=gets.chomp if file1 file1.write(in1) else puts "can't write" end file1.close
Comments
Post a Comment