96件ヒット
[1-96件を表示]
(0.018秒)
検索結果
先頭5件
-
Kernel
. # select(reads , writes = [] , excepts = [] , timeout = nil) -> [[IO]] | nil (102.0) -
IO.select と同じです。
...IO.select と同じです。
@param reads IO.select 参照
@param writes IO.select 参照
@param excepts IO.select 参照
@param timeout IO.select 参照
@see IO.select... -
Kernel
. # spawn(env , program , *args , options={}) -> Integer (38.0) -
引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。
...) # read mode
pid = spawn(command, :out=>"/dev/null") # write mode
pid = spawn(command, :err=>"log") # write mode
pid = spawn(command, 3=>"/dev/null") # read mode
//}
stdout と stderr をリダイレクトした場合は、
ファイルは write mode で open されます。それ以外の場合は......read mode で open されます。
ファイルのフラグ(write/read mode)やパーミッションを明示したい
場合は、配列を用います。
//emlist[][ruby]{
# なにも指定がなければデフォルトで read mode が使われる。
pid = spawn(command, :in=>["file"])
# read m......レクトする。
pid = spawn(command, :in=>["file", "r"])
# write mode で file を open し、リダイレクトする。
# パーミッションはデフォルトで 644。
pid = spawn(command, :out=>["log", "w"]) # 0644 assumed
# write mode、パーミッション 0600 でファイルをオー......din), 1(stdout), 2(stderr) 以外の
ファイルデスクリプタをすべて閉じます。
false がデフォルトです。
: :exception
Kernel.#system のみで指定できます。
これを true に設定すると、nil や false を返す代わりに例外が発生します。
fa... -
Kernel
. # spawn(program , *args) -> Integer (38.0) -
引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。
...) # read mode
pid = spawn(command, :out=>"/dev/null") # write mode
pid = spawn(command, :err=>"log") # write mode
pid = spawn(command, 3=>"/dev/null") # read mode
//}
stdout と stderr をリダイレクトした場合は、
ファイルは write mode で open されます。それ以外の場合は......read mode で open されます。
ファイルのフラグ(write/read mode)やパーミッションを明示したい
場合は、配列を用います。
//emlist[][ruby]{
# なにも指定がなければデフォルトで read mode が使われる。
pid = spawn(command, :in=>["file"])
# read m......レクトする。
pid = spawn(command, :in=>["file", "r"])
# write mode で file を open し、リダイレクトする。
# パーミッションはデフォルトで 644。
pid = spawn(command, :out=>["log", "w"]) # 0644 assumed
# write mode、パーミッション 0600 でファイルをオー......din), 1(stdout), 2(stderr) 以外の
ファイルデスクリプタをすべて閉じます。
false がデフォルトです。
: :exception
Kernel.#system のみで指定できます。
これを true に設定すると、nil や false を返す代わりに例外が発生します。
fa... -
Kernel
. # test(cmd , file1 , file2) -> bool (15.0) -
2ファイル間のファイルテストを行います。
...2より最終更新時刻が古い
: ?-
ファイル1とファイル2が同一のファイルである
//emlist[例][ruby]{
IO.write("testfile1", "test1")
IO.write("testfile2", "test2")
%w(= < > -).each do |e|
result = test(e, "testfile1", "testfile2")
puts "#{e}: #{result}"
end
//}
# => =... -
Kernel
. # test(cmd , file) -> bool | Time | Integer | nil (10.0) -
単体のファイルでファイルテストを行います。
...me
: ?A
ファイルの最終アクセス時刻を返す -> Time
: ?C
ファイルの inode 変更時刻を返す -> Time
//emlist[例][ruby]{
IO.write("testfile", "test")
test("r", "testfile") # => true
test("s", "testfile") # => 4
test("M", "testfile") # => 2018-03-31 07:38:40 +0900
//}... -
Kernel
. # spawn(command , options={}) -> Integer (8.0) -
引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。
...表す Hash
@param options オプションパラメータ Hash
@raise Errno::EXXX 起動に失敗し、ruby インタプリタに制御が戻った場合に発生します。
@raise Errno::EXXX コマンドが実行できなかった場合に発生します。
@see Kernel.#system,Kernel.#exec... -
Kernel
. # spawn(env , command , options={}) -> Integer (8.0) -
引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。
...表す Hash
@param options オプションパラメータ Hash
@raise Errno::EXXX 起動に失敗し、ruby インタプリタに制御が戻った場合に発生します。
@raise Errno::EXXX コマンドが実行できなかった場合に発生します。
@see Kernel.#system,Kernel.#exec... -
Kernel
. # syscall(num , *arg) -> Integer (8.0) -
numで指定された番号のシステムコールを実行します。 第2引数以降をシステムコールの引数として渡します。
...-1 を返した場合に発生します。
@raise NotImplementedError 実行環境がこのメソッドに対応していないとき発生します。
//emlist[例][ruby]{
syscall 4, 1, "hello\n", 6 # '4' is write(2) on our box
# => hello
//}
@see fiddle, syscall(2freebsd), syscall(2linux)...