Ruby/File Directory/sysread

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

Версия от 17:10, 26 мая 2010; (Обсуждение)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

use the method sysread to read the contents of a file.

file3 = File.new("C:\\Ruby\\Sample"," r")
file3.sysread(20)
# This statement will output the first 20 characters of the file. 
# The file pointer will now be placed at the 21st character in the file.