440件ヒット
[1-100件を表示]
(0.115秒)
種類
- モジュール関数 (165)
- インスタンスメソッド (154)
- 特異メソッド (110)
- クラス (11)
クラス
- BasicObject (33)
- File (22)
-
File
:: Stat (22) - IO (110)
- String (77)
キーワード
- ELIBEXEC (11)
- []= (77)
- ` (11)
-
close
_ on _ exec= (11) -
close
_ on _ exec? (11) - executable? (33)
-
executable
_ real? (33) -
instance
_ eval (22) -
instance
_ exec (11) - popen (88)
- spawn (44)
- system (44)
検索結果
先頭5件
-
Kernel
. # exec(env , program , *args , options={}) -> () (26225.0) -
引数で指定されたコマンドを実行します。
...式では、常に shell を経由せずに実行されます。
exec(3) でコマンドを実行すると、
元々のプログラムの環境をある程度(ファイルデスクリプタなど)引き継ぎます。
Hash を options として渡すことで、この挙動を変更できます。......am options オプションパラメータ Hash
@raise ArgumentError 第一引数が配列かつ要素数が 2 でない場合に発生します。
@raise Errno::EXXX 起動に失敗し、ruby インタプリタに制御が戻った場合に発生します。
//emlist[例][ruby]{
# a.rb
exec ['sle......替えて以下を実行
$ ps aux|grep sleep
xxxx 32754 0.0 0.0 2580 468 pts/3 S+ 22:01 0:00 mysleep 600
xxxx 32761 0.0 0.0 2824 792 pts/6 S+ 22:01 0:00 grep sleep
@see Kernel.#system,Kernel.#`,Kernel.#spawn,Kernel.#fork,IO.popen,IO.pipe,Kernel.#open,exec(3)... -
Kernel
. # exec(program , *args , options={}) -> () (26225.0) -
引数で指定されたコマンドを実行します。
...式では、常に shell を経由せずに実行されます。
exec(3) でコマンドを実行すると、
元々のプログラムの環境をある程度(ファイルデスクリプタなど)引き継ぎます。
Hash を options として渡すことで、この挙動を変更できます。......am options オプションパラメータ Hash
@raise ArgumentError 第一引数が配列かつ要素数が 2 でない場合に発生します。
@raise Errno::EXXX 起動に失敗し、ruby インタプリタに制御が戻った場合に発生します。
//emlist[例][ruby]{
# a.rb
exec ['sle......替えて以下を実行
$ ps aux|grep sleep
xxxx 32754 0.0 0.0 2580 468 pts/3 S+ 22:01 0:00 mysleep 600
xxxx 32761 0.0 0.0 2824 792 pts/6 S+ 22:01 0:00 grep sleep
@see Kernel.#system,Kernel.#`,Kernel.#spawn,Kernel.#fork,IO.popen,IO.pipe,Kernel.#open,exec(3)... -
Kernel
. # exec(command , options={}) -> () (26215.0) -
引数で指定されたコマンドを実行します。
...list{
* ? {} [] <> () ~ & | \ $ ; ' ` " \n
//}
を含む場合、shell 経由で実行されます。
そうでなければインタプリタから直接実行されます。
@param command コマンドを文字列で指定します。
@param env 更新する環境変数を表す Hash
@param opti......ons オプションパラメータ Hash
@raise Errno::EXXX 起動に失敗し、ruby インタプリタに制御が戻った場合に発生します。
//emlist[例][ruby]{
# a.rb
puts '実行前'
exec 'echo "実行中"'
puts '実行後'
//}
上記のスクリプトを実行すると以下のよ... -
Kernel
. # exec(env , command , options={}) -> () (26215.0) -
引数で指定されたコマンドを実行します。
...list{
* ? {} [] <> () ~ & | \ $ ; ' ` " \n
//}
を含む場合、shell 経由で実行されます。
そうでなければインタプリタから直接実行されます。
@param command コマンドを文字列で指定します。
@param env 更新する環境変数を表す Hash
@param opti......ons オプションパラメータ Hash
@raise Errno::EXXX 起動に失敗し、ruby インタプリタに制御が戻った場合に発生します。
//emlist[例][ruby]{
# a.rb
puts '実行前'
exec 'echo "実行中"'
puts '実行後'
//}
上記のスクリプトを実行すると以下のよ... -
BasicObject
# instance _ exec(*args) {|*vars| . . . } -> object (20221.0) -
与えられたブロックをレシーバのコンテキストで実行します。
...タに渡す値です。
//emlist[例][ruby]{
class KlassWithSecret
def initialize
@secret = 99
end
end
k = KlassWithSecret.new
# 以下で x には 5 が渡される
k.instance_exec(5) {|x| @secret + x } #=> 104
//}
@see Module#class_exec, Module#module_exec, BasicObject#instance_eval... -
Errno
:: ELIBEXEC (20002.0) -
システムコールのエラーコードを表す例外クラスです。詳細は Errno::EXXX を参照してください。
システムコールのエラーコードを表す例外クラスです。詳細は Errno::EXXX を参照してください。 -
FileTest
. # executable?(file) -> bool (17202.0) -
ファイルがカレントプロセスにより実行できる時に真を返しま す。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。
...合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。
@param file ファイル名を表す文字列を指定します。
例:
FileTest.executable?('/bin') # => true
FileTest.executable?('/bin/bash') # => true... -
FileTest
. # executable _ real?(file) -> bool (17202.0) -
ファイルがカレントプロセスの実ユーザか実グループで実行できる時に真を返します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。
...alse を返します。
@param file ファイル名を表す文字列を指定します。
//emlist[例][ruby]{
IO.write("empty.txt", "")
File.chmod(0744, "empty.txt")
FileTest.executable_real?("empty.txt") # => true
File.chmod(0644, "empty.txt")
FileTest.executable_real?("empty.txt") #... -
IO
# close _ on _ exec? -> bool (17155.0) -
自身に close-on-exec フラグが設定されていた場合 true を返します。 そうでない場合に false を返します。
...close-on-exec フラグが設定されていた場合 true を返します。
そうでない場合に false を返します。
f = open("/dev/null")
f.close_on_exec? #=> true
f.close_on_exec = false
f.close_on_exec? #=> false
f.close_on_exec = true......f.close_on_exec? #=> true
@see IO#close_on_exec=... -
IO
# close _ on _ exec=(bool) (17143.0) -
自身に close-on-exec フラグを設定します。
...-on-exec フラグを設定します。
このフラグをセットすると exec(2) 時にそのファイルデスクリプタを
close します。
@see fcntl(2)
@param bool 自身の close-on-exec フラグを true か false で指定します。
f = open("/dev/null")
f.close_on_exec = t......rue
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?...