Ruby/File Directory/IO.read

Материал из Wiki.crossplatform.ru

(Различия между версиями)
Перейти к: навигация, поиск
м (1 версия: Импорт выборки материалов по Ruby)
 

Текущая версия на 17:57, 13 сентября 2010

Read 4 bytes starting at byte 2

data = IO.read("data", 4, 2)   # Read 4 bytes starting at byte 2



Read and return the entire file

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



Read from byte 6 to end-of-file

data = IO.read("data", nil, 6) # Read from byte 6 to end-of-file