るりまサーチ

最速Rubyリファレンスマニュアル検索!
1366件ヒット [1301-1366件を表示] (0.076秒)

別のキーワード

  1. socket open
  2. _builtin open
  3. csv open
  4. tempfile open
  5. zlib open

ライブラリ

モジュール

キーワード

検索結果

<< < ... 12 13 14 >>

FileTest.#directory?(file) -> bool (7.0)

ファイルがディレクトリの時に真を返します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。

...ブジェクト file が既に close されていた場合に発生します。

例:
FileTest.directory?('/etc') # => true
FileTest.directory?('/etc/passwd') # => false

f = File.open('/etc')
FileTest.directory?(f) # => true
f.close
FileTest.directory?(f) # => IOError: closed stream...

JSON.#dump(object, io = nil, limit = nil) -> String | IO (7.0)

与えられたオブジェクトを JSON 形式の文字列に変換してダンプします。

...uby]{
require "json"

JSON.dump({ name: "tanaka", age: 19 }) # => "{\"name\":\"tanaka\",\"age\":19}"
//}

//emlist[例][ruby]{
require "json"

File.open("test.txt", "w") do |f|
JSON.dump([[[[[[[[[[]]]]]]]]]], f, 10) # => #<File:test.txt>
JSON.dump([[[[[[[[[[[]]]]]]]]]]], f, 10) # => exceed dep...

Kernel.#exec(env, program, *args, options={}) -> () (7.0)

引数で指定されたコマンドを実行します。

...替えて以下を実行
$ 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={}) -> () (7.0)

引数で指定されたコマンドを実行します。

...替えて以下を実行
$ 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={}) -> () (2.0)

引数で指定されたコマンドを実行します。

引数で指定されたコマンドを実行します。

プロセスの実行コードはそのコマンド(あるいは shell)になるので、
起動に成功した場合、このメソッドからは戻りません。

=== 引数の解釈

この形式では command が shell のメタ文字
//emlist{
* ? {} [] <> () ~ & | \ $ ; ' ` " \n
//}
を含む場合、shell 経由で実行されます。
そうでなければインタプリタから直接実行されます。

@param command コマンドを文字列で指定します。
@param env 更新する環境変数を表す Hash
@param options...

絞り込み条件を変える

Kernel.#exec(env, command, options={}) -> () (2.0)

引数で指定されたコマンドを実行します。

引数で指定されたコマンドを実行します。

プロセスの実行コードはそのコマンド(あるいは shell)になるので、
起動に成功した場合、このメソッドからは戻りません。

=== 引数の解釈

この形式では command が shell のメタ文字
//emlist{
* ? {} [] <> () ~ & | \ $ ; ' ` " \n
//}
を含む場合、shell 経由で実行されます。
そうでなければインタプリタから直接実行されます。

@param command コマンドを文字列で指定します。
@param env 更新する環境変数を表す Hash
@param options...
<< < ... 12 13 14 >>