Read and return the entire file : IO.read « File Directory « Ruby






Read and return the entire file


data = IO.read("data")         # Read and return the entire file

 

Related examples in the same category

1.Read 4 bytes starting at byte 2
2.Read from byte 6 to end-of-file