クラス
- Dir (66)
- File (88)
- IO (374)
- Mutex (2)
- Thread (203)
-
Thread
:: ConditionVariable (9) -
Thread
:: Mutex (9) -
Thread
:: Queue (12) -
Thread
:: SizedQueue (9) - ThreadGroup (11)
キーワード
- DEBUG (11)
- DEBUG= (11)
-
abort
_ on _ exception (11) -
abort
_ on _ exception= (11) - binread (11)
-
copy
_ stream (22) - current (11)
- exclusive (11)
- exit (11)
- fork (11)
-
handle
_ interrupt (11) - kill (11)
- link (11)
- list (11)
- main (11)
- new (96)
- open (66)
- pass (11)
-
pending
_ interrupt? (11) - pipe (88)
- popen (154)
- readable? (11)
-
readable
_ real? (11) - readlines (33)
- readlink (11)
-
report
_ on _ exception (8) -
report
_ on _ exception= (8) - select (11)
- start (11)
- stop (11)
-
world
_ readable? (11) - write (22)
検索結果
先頭5件
-
IO
. read(path , **opt) -> String | nil (18142.0) -
path で指定されたファイルを offset 位置から length バイト分読み込んで返します。
...合は nil を返します。ただし、length に nil か 0 が指定されている場合は、空文字列 "" を返します。例えば、IO.read(空ファイル) は "" を返します。
引数 length が指定された場合はバイナリ読み込みメソッド、そうでない場合は......ng など
IO.open のオプション引数が指定できます。
@see IO.binread
例:
IO.read(empty_file) #=> ""
IO.read(empty_file, 1) #=> nil
IO.read(one_byte_file, 0, 10) #=> ""
IO.read(one_byte_file, nil, 10) #=> ""
IO.read(one_byte_file, 1, 10) #=> nil... -
IO
. read(path , length = nil , **opt) -> String | nil (18142.0) -
path で指定されたファイルを offset 位置から length バイト分読み込んで返します。
...合は nil を返します。ただし、length に nil か 0 が指定されている場合は、空文字列 "" を返します。例えば、IO.read(空ファイル) は "" を返します。
引数 length が指定された場合はバイナリ読み込みメソッド、そうでない場合は......ng など
IO.open のオプション引数が指定できます。
@see IO.binread
例:
IO.read(empty_file) #=> ""
IO.read(empty_file, 1) #=> nil
IO.read(one_byte_file, 0, 10) #=> ""
IO.read(one_byte_file, nil, 10) #=> ""
IO.read(one_byte_file, 1, 10) #=> nil... -
IO
. read(path , length = nil , offset = 0 , **opt) -> String | nil (18142.0) -
path で指定されたファイルを offset 位置から length バイト分読み込んで返します。
...合は nil を返します。ただし、length に nil か 0 が指定されている場合は、空文字列 "" を返します。例えば、IO.read(空ファイル) は "" を返します。
引数 length が指定された場合はバイナリ読み込みメソッド、そうでない場合は......ng など
IO.open のオプション引数が指定できます。
@see IO.binread
例:
IO.read(empty_file) #=> ""
IO.read(empty_file, 1) #=> nil
IO.read(one_byte_file, 0, 10) #=> ""
IO.read(one_byte_file, nil, 10) #=> ""
IO.read(one_byte_file, 1, 10) #=> nil... -
IO
. binread(path , length = nil , offset = 0) -> String | nil (6109.0) -
path で指定したファイルを open し、offset の所まで seek し、 length バイト読み込みます。
...ine 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("testfile", 20, 10) # => "ne one\nThis is line "
//}
@see IO.read... -
File
. readable?(path) -> bool (6103.0) -
FileTest.#readable? と同じです。
...FileTest.#readable? と同じです。
@param path パスを表す文字列か IO オブジェクトを指定します。... -
File
. readable _ real?(path) -> bool (6103.0) -
FileTest.#readable_real? と同じです。
...FileTest.#readable_real? と同じです。
@param path パスを表す文字列か IO オブジェクトを指定します。... -
File
. readlink(path) -> String (6103.0) -
シンボリックリンクのリンク先のパスを文字列で返します。
...XX 指定された path がシンボリックリンクでない場合や、リンクの読み取りに失敗した場合に発生します。
//emlist[例:][ruby]{
IO.write("testfile", "test")
File.symlink("testfile", "testlink") # => 0
File.readlink("testlink") # => "testfile"
//}... -
File
. world _ readable?(path) -> Integer | nil (6103.0) -
path が全てのユーザから読めるならばそのファイルのパーミッションを表す 整数を返します。そうでない場合は nil を返します。
...場合は nil を返します。
整数の意味はプラットフォームに依存します。
@param path パスを表す文字列か IO オブジェクトを指定します。
//emlist[例][ruby]{
m = File.world_readable?("/etc/passwd")
"%o" % m # => "644"
//}... -
IO
. readlines(path , limit , chomp: false , opts={}) -> [String] (6103.0) -
path で指定されたファイルを全て読み込んで、その各行を要素としてもつ配列を返します。
...,\nline3\n")
IO.readlines("testfile") # => ["line1\n", "line2,\n", "line3\n"]
IO.readlines("testfile", ",") # => ["line1\nline2,", "\nline3\n"]
//}
//emlist[例: rs を取り除く(chomp = true)][ruby]{
IO.write("testfile", "line1,\rline2,\r\nline3,\n")
IO.readlines("testfile......", chomp: true) # => ["line1,\rline2,", "line3,"]
IO.readlines("testfile", "\r", chomp: true) # => ["line1,", "line2,", "\nline3,\n"]
//}... -
IO
. readlines(path , limit , opts={}) -> [String] (6103.0) -
path で指定されたファイルを全て読み込んで、その各行を要素としてもつ配列を返します。
...、ファイルの読み込みに失敗した場合に発生します。
//emlist[例][ruby]{
IO.write("testfile", "line1\nline2,\nline3\n")
IO.readlines("testfile") # => ["line1\n", "line2,\n", "line3\n"]
IO.readlines("testfile", ",") # => ["line1\nline2,", "\nline3\n"]
//}... -
IO
. readlines(path , rs = $ / , chomp: false , opts={}) -> [String] (6103.0) -
path で指定されたファイルを全て読み込んで、その各行を要素としてもつ配列を返します。
...,\nline3\n")
IO.readlines("testfile") # => ["line1\n", "line2,\n", "line3\n"]
IO.readlines("testfile", ",") # => ["line1\nline2,", "\nline3\n"]
//}
//emlist[例: rs を取り除く(chomp = true)][ruby]{
IO.write("testfile", "line1,\rline2,\r\nline3,\n")
IO.readlines("testfile......", chomp: true) # => ["line1,\rline2,", "line3,"]
IO.readlines("testfile", "\r", chomp: true) # => ["line1,", "line2,", "\nline3,\n"]
//}...