ライブラリ
- ビルトイン (2594)
クラス
-
ARGF
. class (198) - Dir (110)
-
Encoding
:: Converter (11) -
Encoding
:: InvalidByteSequenceError (11) - Exception (11)
- File (99)
-
File
:: Stat (44) - IO (668)
- Method (12)
- Module (11)
- Mutex (2)
- Object (26)
- Proc (12)
- String (11)
- Thread (610)
-
Thread
:: Backtrace :: Location (77) -
Thread
:: ConditionVariable (36) -
Thread
:: Mutex (72) -
Thread
:: Queue (129) -
Thread
:: SizedQueue (111) - ThreadGroup (66)
キーワード
- << (30)
- >> (12)
-
CLOCK
_ THREAD _ CPUTIME _ ID (11) - ConditionVariable (9)
- DEBUG (11)
- DEBUG= (11)
- Default (11)
- EALREADY (11)
- IO (11)
- Location (11)
-
MUTEX
_ FOR _ THREAD _ EXCLUSIVE (5) - Mutex (9)
- Queue (9)
- SizedQueue (9)
- Thread (11)
- ThreadError (11)
- ThreadGroup (11)
- WaitReadable (11)
- [] (11)
- []= (11)
-
abort
_ on _ exception (22) -
abort
_ on _ exception= (22) -
absolute
_ path (11) - add (11)
-
add
_ trace _ func (11) - alive? (11)
-
attr
_ reader (11) - backtrace (11)
-
backtrace
_ locations (33) -
base
_ label (11) - binmode (11)
- binread (11)
- birthtime (11)
- broadcast (9)
-
caller
_ locations (22) - clear (9)
- clone (11)
- close (29)
-
close
_ read (11) -
close
_ write (11) - closed? (20)
-
copy
_ stream (22) - count (11)
- current (11)
- deq (18)
- detach (11)
- dup (11)
- empty? (16)
- enclose (11)
- enclosed? (11)
- enq (18)
- exclusive (11)
- exit (22)
- fdatasync (11)
- fetch (7)
- file (11)
- filename (11)
- flock (11)
- flush (11)
- fork (11)
- getc (11)
- group (11)
-
handle
_ interrupt (11) -
ignore
_ deadlock (3) -
ignore
_ deadlock= (3) - inspect (22)
- join (22)
- key? (11)
- keys (11)
- kill (22)
- label (11)
- length (16)
- lineno (11)
- link (11)
- list (22)
- lock (9)
- locked? (9)
- main (11)
- max (9)
- max= (9)
- name (9)
- name= (9)
- new (96)
-
num
_ waiting (9) - open (66)
- owned? (9)
- pass (11)
- path (22)
-
pending
_ interrupt? (22) - pipe (88)
- pop (18)
- popen (154)
- pos= (11)
- pread (7)
-
primitive
_ errinfo (11) - priority (11)
- priority= (11)
- push (18)
- pwrite (7)
- raise (11)
-
read
_ nonblock (22) - readable? (33)
-
readable
_ real? (33) -
readagain
_ bytes (11) - readbyte (22)
- readchar (22)
- readline (77)
- readlines (110)
- readlink (11)
- readpartial (22)
-
report
_ on _ exception (16) -
report
_ on _ exception= (16) - rewind (11)
- run (11)
-
safe
_ level (7) - seek (11)
- select (22)
-
set
_ encoding _ by _ bom (5) -
set
_ trace _ func (11) - shift (18)
- signal (9)
- size (16)
- sleep (9)
- spawn (44)
- start (11)
- status (11)
- stop (11)
- stop? (11)
- synchronize (9)
- sysread (11)
- sysseek (11)
- syswrite (11)
- terminate (11)
- then (12)
-
thread
_ variable? (11) -
thread
_ variable _ get (11) -
thread
_ variable _ set (11) -
to
_ a (33) -
to
_ s (18) -
try
_ lock (9) - ungetc (11)
- unlock (9)
- value (11)
- wait (9)
- wakeup (11)
-
world
_ readable? (33) - write (33)
-
yield
_ self (14)
検索結果
先頭5件
- Thread
:: MUTEX _ FOR _ THREAD _ EXCLUSIVE -> Mutex - IO
# read _ nonblock(maxlen , outbuf = nil , exception: true) -> String | Symbol | nil - ARGF
. class # read _ nonblock(maxlen , outbuf = nil) -> String - ARGF
. class # read _ nonblock(maxlen , outbuf = nil , exception: true) -> String | Symbol | nil - ARGF
. class # readpartial(maxlen , outbuf = nil) -> String
-
Thread
:: MUTEX _ FOR _ THREAD _ EXCLUSIVE -> Mutex (17100.0) -
Thread.exclusive用のMutexオブジェクトです。 (private constant です。)
...Thread.exclusive用のMutexオブジェクトです。......Thread.exclusive用のMutexオブジェクトです。
(private constant です。)... -
IO
# read _ nonblock(maxlen , outbuf = nil , exception: true) -> String | Symbol | nil (14153.0) -
IO をノンブロッキングモードに設定し、 その後で read(2) システムコールにより 長さ maxlen を上限として読み込み、文字列として返します。 EAGAIN, EINTR などは Errno::EXXX 例外として呼出元に報告されます。
...IO をノンブロッキングモードに設定し、
その後で read(2) システムコールにより
長さ maxlen を上限として読み込み、文字列として返します。
EAGAIN, EINTR などは Errno::EXXX 例外として呼出元に報告されます。
発生した例外 がErr......CK である場合は、
その例外オブジェクトに IO::WaitReadable が Object#extend
されます。
なお、バッファが空でない場合は、read_nonblock はバッファから読み込みます。この場合、read(2) システムコールは呼ばれません。
このメソッ......ドはノンブロッキングモードにする点を除いて IO#readpartial と
同じであることに注意してください。
バイナリ読み込みメソッドとして動作します。
既に EOF に達していれば EOFError が発生します。ただし、maxlen に 0 が指定... -
ARGF
. class # read _ nonblock(maxlen , outbuf = nil) -> String (14123.0) -
処理中のファイルからノンブロッキングモードで最大 maxlen バイト読み込みます。 詳しくは IO#read_nonblock を参照してください。
...のファイルからノンブロッキングモードで最大 maxlen バイト読み込みます。
詳しくは IO#read_nonblock を参照してください。
ARGF.class#read などとは違って複数ファイルを同時に読み込むことはありません。
@param maxlen 読み込む......長さの上限を整数で指定します。
@param outbuf 読み込んだデータを格納する String オブジェクトを指定します。
@see ARGF.class#readpartial... -
ARGF
. class # read _ nonblock(maxlen , outbuf = nil , exception: true) -> String | Symbol | nil (14123.0) -
処理中のファイルからノンブロッキングモードで最大 maxlen バイト読み込みます。 詳しくは IO#read_nonblock を参照してください。
...のファイルからノンブロッキングモードで最大 maxlen バイト読み込みます。
詳しくは IO#read_nonblock を参照してください。
ARGF.class#read などとは違って複数ファイルを同時に読み込むことはありません。
@param maxlen 読み込む......::EWOULDBLOCK が発生する代わりに
:wait_readable を返すかどうかを指定します。また、false
を指定した場合は既に EOF に達していれば
EOFError の代わりに nil を返します。
@see ARGF.class#readpartial... -
ARGF
. class # readpartial(maxlen , outbuf = nil) -> String (14122.0) -
IO#readpartialを参照。ARGF.class#read などとは違って複数ファ イルを同時に読み込むことはありません。
...IO#readpartialを参照。ARGF.class#read などとは違って複数ファ
イルを同時に読み込むことはありません。
@param maxlen 読み込む長さの上限を整数で指定します。
@param outbuf 読み込んだデータを格納する String オブジェクトを指定し......ます。
@see IO#readpartial, ARGF.class#read_nonblock... -
IO
# sysread(maxlen , outbuf = "") -> String (14116.0) -
read(2) を用いて入力を行ない、入力されたデータを 含む文字列を返します。stdio を経由しないので gets や getc や eof? などと混用すると思わぬ動作 をすることがあります。
...
read(2) を用いて入力を行ない、入力されたデータを
含む文字列を返します。stdio を経由しないので gets や getc や eof? などと混用すると思わぬ動作
をすることがあります。
バイナリ読み込みメソッドとして動作します。
既......。
@param maxlen 入力のサイズを整数で指定します。
@param outbuf 出力用のバッファを文字列で指定します。IO#sysread は読み込んだデータを
その文字列オブジェクトに上書きして返します。指定した文字列オブジェク......す。
第二引数を指定した sysread の呼び出しでデータが空であった場
合(sysread が例外 EOFError を発生させる場合)、
outbuf は空文字列になります。
outbuf = "x" * 20;
io = File.open("/dev/null")
p((io.sysread(10,outbuf) rescue nil))
p outbuf
=... -
IO
# pread(maxlen , offset , outbuf = "") -> string (14112.0) -
preadシステムコールを使ってファイルポインタを変更せずに、また現在のファイルポインタに 依存せずにmaxlenバイト読み込みます。
...preadシステムコールを使ってファイルポインタを変更せずに、また現在のファイルポインタに
依存せずにmaxlenバイト読み込みます。
IO#seekとIO#readの組み合わせと比べて、アトミックな操作に
なるという点が優れていて、複......ない OS で発生します。
//emlist[例][ruby]{
File.write("testfile", "This is line one\nThis is line two\n")
File.open("testfile") do |f|
p f.read # => "This is line one\nThis is line two\n"
p f.pread(12, 0) # => "This is line"
p f.pread(9, 8) # => "line one\n"
end
//}... -
IO
# close _ read -> nil (14107.0) -
読み込み用の IO を close します。主にパイプや読み書き両用に作成し た IO オブジェクトで使用します。
...オープンされていなければ発生します。
@raise Errno::EXXX close に失敗した場合に発生します。
//emlist[例][ruby]{
IO.popen("/bin/sh","r+") do |f|
f.close_read
# f.readlines # => IOError: not opened for reading
end
//}
@see IO#close, IO#closed?, IO#close_write... -
IO
# readchar -> String (14106.0) -
IO ポートから 1 文字読み込んで返します。 EOF に到達した時には EOFError が発生します。
...込み用にオープンされていなければ発生します。
f = File.new("testfile")
p f.readchar #=> "い"
p f.readchar #=> "ろ"
p f.readchar #=> "は"
f.read
f.readchar #=> EOFError
@see IO#getc... -
IO
. binread(path , length = nil , offset = 0) -> String | nil (14106.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... -
ARGF
. class # readbyte -> Integer (14100.0) -
自身から 1 バイトを読み込み整数として返します。 既に EOF に達していれば EOFError が発生します。
...が発生します。
@raise EOFError 既に EOF に達している場合に発生します。
$ echo "foo" > file
$ ruby argf.rb file
ARGF.readbyte # => 102
ARGF.readbyte # => 111
ARGF.readbyte # => 111
ARGF.readbyte # => 10
ARGF.readbyte # => end of file reached (EOFError)... -
ARGF
. class # readchar -> String (14100.0) -
ARGFから 1 文字読み込んで、その文字に対応する String を返します。EOF に 到達した時には EOFErrorを発生します。
...rorを発生します。
@raise EOFError EOFに達した時発生する
$ echo "foo" > file
$ ruby argf.rb file
ARGF.readchar # => "f"
ARGF.readchar # => "o"
ARGF.readchar # => "o"
ARGF.readchar # => "\n"
ARGF.readchar # => end of file reached (EOFError)
@see ARGF.class#getc...