246件ヒット
[201-246件を表示]
(0.080秒)
ライブラリ
- ビルトイン (180)
- logger (12)
- shell (18)
-
shell
/ command-processor (18) -
shell
/ filter (18)
クラス
- File (12)
-
File
:: Stat (96) - IO (72)
-
Logger
:: LogDevice (12) - Shell (18)
-
Shell
:: CommandProcessor (18) -
Shell
:: Filter (18)
検索結果
先頭4件
-
IO
# tty? -> bool (19.0) -
入出力ポートがttyに結合している時、真を返します。そうでない場合 false を返します。
...入出力ポートがttyに結合している時、真を返します。そうでない場合 false を返します。
@raise IOError 既に close されている場合に発生します。
//emlist[例][ruby]{
File.new("testfile").isatty # => false
File.new("/dev/tty").isatty # => true
//}... -
IO
# close _ on _ exec=(bool) (13.0) -
自身に close-on-exec フラグを設定します。
...2)
@param bool 自身の close-on-exec フラグを true か false で指定します。
f = open("/dev/null")
f.close_on_exec = true
system("cat", "/proc/self/fd/#{f.fileno}") # cat: /proc/self/fd/3: No such file or directory
f.closed? #=> false
@see IO#close_on_exec?... -
IO
# read(length = nil , outbuf = "") -> String | nil (13.0) -
length バイト読み込んで、その文字列を返します。
...負の場合に発生します。
第二引数を指定した read の呼び出しでデータが空であった場合
(read が nil を返す場合)、outbuf は空文字列になります。
outbuf = "x" * 20;
io = File.open("/dev/null")
p io.read(10,outbuf)
p outbuf
=> nil
""... -
IO
# sysread(maxlen , outbuf = "") -> String (13.0) -
read(2) を用いて入力を行ない、入力されたデータを 含む文字列を返します。stdio を経由しないので gets や getc や eof? などと混用すると思わぬ動作 をすることがあります。
...数を指定した sysread の呼び出しでデータが空であった場
合(sysread が例外 EOFError を発生させる場合)、
outbuf は空文字列になります。
outbuf = "x" * 20;
io = File.open("/dev/null")
p((io.sysread(10,outbuf) rescue nil))
p outbuf
=> nil
""...