The method syswrite writes the contents of the file. : syswrite « File Directory « Ruby






The method syswrite writes the contents of the file.


file4 = File.new("C:\\Ruby\\Sample", "r+")

puts file4.sysread(20)
file4.syswrite("ABCDEF")

# write ABCDEF from the 21st character onward.

 








Related examples in the same category

1.Save what you read to a file