るりまサーチ

最速Rubyリファレンスマニュアル検索!
84件ヒット [1-84件を表示] (0.078秒)

別のキーワード

  1. optparse on
  2. optionparser on
  3. tracer on
  4. thread abort_on_exception
  5. thread abort_on_exception=

ライブラリ

キーワード

検索結果

IO.console -> File | nil (6102.0)

端末を File オブジェクトで返します。

...端末を File オブジェクトで返します。

require "io/console"
IO
.console # => #<File:/dev/tty>

プロセスが端末から切り離された状態で実行すると nil を返します。

戻り値はプラットフォームや環境に依存します。...

IO.console_size -> [Integer, Integer] (6102.0)

端末のサイズを [rows, columns] で返します。

...端末のサイズを [rows, columns] で返します。

io
/console が利用できない場合は、IO.default_console_size
の値を返します。

@see IO.default_console_size...

IO.default_console_size -> [Integer, Integer] (6102.0)

デフォルトの端末のサイズを [rows, columns] で返します。

デフォルトの端末のサイズを [rows, columns] で返します。

IO.try_convert(obj) -> IO | nil (6102.0)

obj を to_io メソッドによって IO オブジェクトに変換します。 変換できなかった場合は nil を返します。

...obj を to_io メソッドによって IO オブジェクトに変換します。
変換できなかった場合は nil を返します。

IO
.try_convert(STDOUT) # => STDOUT
IO
.try_convert("STDOUT") # => nil...

IO.binread(path, length = nil, offset = 0) -> String | nil (14.0)

path で指定したファイルを open し、offset の所まで seek し、 length バイト読み込みます。

...ist[例][ruby]{
IO
.write("testfile", "This is line one\nThis is line two\nThis is line three\nAnd so on...\n")
IO
.binread("testfile") # => "This is line one\nThis is line two\nThis is line three\nAnd so on...\n"
IO
.binread("testfile", 20) # => "This is line one\nThi"
IO
.binread("test...
...file", 20, 10) # => "ne one\nThis is line "
//}

@see IO.read...

絞り込み条件を変える

IO.write(path, string, **opts) -> Integer (14.0)

path で指定されるファイルを開き、string を書き込み、 閉じます。

...ます。
詳しくは IO.open を見てください。

@param path ファイル名文字列
@param string 書き込む文字列
@param offset 書き込み開始位置
@param opts ファイルを開くときのキーワード引数

//emlist[例][ruby]{
text = "This is line one\nThis is line two\nT...
...is is line three\nAnd so on...\n"
IO
.write("testfile", text) # => 66
IO
.write("testfile", "0123456789", 20) #=> 10
IO
.read("testfile")
# => "This is line one\nThi0123456789two\nThis is line three\nAnd so on...\n"
IO
.write("testfile", "0123456789") #=> 10
IO
.read("testfile")...
...# => "0123456789"
//}

@see IO.binwrite...

IO.write(path, string, offset=nil, **opts) -> Integer (14.0)

path で指定されるファイルを開き、string を書き込み、 閉じます。

...ます。
詳しくは IO.open を見てください。

@param path ファイル名文字列
@param string 書き込む文字列
@param offset 書き込み開始位置
@param opts ファイルを開くときのキーワード引数

//emlist[例][ruby]{
text = "This is line one\nThis is line two\nT...
...is is line three\nAnd so on...\n"
IO
.write("testfile", text) # => 66
IO
.write("testfile", "0123456789", 20) #=> 10
IO
.read("testfile")
# => "This is line one\nThi0123456789two\nThis is line three\nAnd so on...\n"
IO
.write("testfile", "0123456789") #=> 10
IO
.read("testfile")...
...# => "0123456789"
//}

@see IO.binwrite...