Ruby/File Directory/IO.fileno

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

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

test what the numeric file descriptor is for your I/O stream (to_i also works).

ios = IO.new( 1, "w" )
ios.puts "IO, IO, it"s off to the computer lab I go."
ios.fileno # => 1
ios.to_i # => 1
$stdout.fileno # => 1