るりまサーチ

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

別のキーワード

  1. _builtin file?
  2. _builtin file
  3. file path
  4. file open
  5. file chown

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 > >>

File#chmod(mode) -> 0 (21012.0)

ファイルのモードを指定された mode に変更します。

...EXXX が発生し
ます。

@param mode chmod(2) と同様に整数で指定します。

@raise IOError 自身が close されている場合に発生します。

@raise Errno::EXXX 失敗した場合に発生します。

//emlist[例][ruby]{
f = File.new("out", "w");
f.chmod(0644) #=> 0
//}...

Shell#out(dev = STDOUT, &block) -> () (18219.0)

Shell#transact を呼び出しその結果を dev に出力します。

...ェクトなどで指定します。

@param block transact 内部で実行するシェルを指定します。


使用例:
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
File
.open("out.txt", "w"){ |fp|
sh.out(fp) {
system("ls", "-l") | head("-n 3")
}
}...

Shell::CommandProcessor#out(dev = STDOUT, &block) -> () (18219.0)

Shell#transact を呼び出しその結果を dev に出力します。

...ェクトなどで指定します。

@param block transact 内部で実行するシェルを指定します。


使用例:
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
File
.open("out.txt", "w"){ |fp|
sh.out(fp) {
system("ls", "-l") | head("-n 3")
}
}...

Shell::Filter#out(dev = STDOUT, &block) -> () (18219.0)

Shell#transact を呼び出しその結果を dev に出力します。

...ェクトなどで指定します。

@param block transact 内部で実行するシェルを指定します。


使用例:
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
File
.open("out.txt", "w"){ |fp|
sh.out(fp) {
system("ls", "-l") | head("-n 3")
}
}...

Timeout.#timeout(sec, exception_class = nil) {|i| ... } -> object (9112.0)

ブロックを sec 秒の期限付きで実行します。 ブロックの実行時間が制限を過ぎたときは例外 Timeout::Error が発生します。

...秒の期限付きで実行します。
ブロックの実行時間が制限を過ぎたときは例外
Timeout::Error が発生します。

exception_class を指定した場合には Timeout::Error の代わりに
その例外が発生します。
ブロックパラメータ i は sec がはい...
...
require 'timeout'

def calc_pi(min)
loop do
x = rand
y = rand
x**2 + y**2 < 1.0 ? min[0] += 1 : min[1] += 1
end
end

t = 5
min = [ 0, 0]
begin
Timeout.timeout(t){
calc_pi(min)
}
rescue Timeout::Error
puts "timeout"
end

printf "%d:...
...Kernel.#openを使用するなどの工夫が必要です。

例 外部コマンドのタイムアウト
require 'timeout'

# テスト用のシェルをつくる。
File
.open("loop.sh", "w"){|fp|
fp.print <<SHELL_EOT
#!/bin/bash

S="scale=10"
M=32767

trap 'echo "$S; $m1/($m1+$m2...

絞り込み条件を変える

Timeout.#timeout(sec, exception_class, message) {|i| ... } -> object (9112.0)

ブロックを sec 秒の期限付きで実行します。 ブロックの実行時間が制限を過ぎたときは例外 Timeout::Error が発生します。

...秒の期限付きで実行します。
ブロックの実行時間が制限を過ぎたときは例外
Timeout::Error が発生します。

exception_class を指定した場合には Timeout::Error の代わりに
その例外が発生します。
ブロックパラメータ i は sec がはい...
...
require 'timeout'

def calc_pi(min)
loop do
x = rand
y = rand
x**2 + y**2 < 1.0 ? min[0] += 1 : min[1] += 1
end
end

t = 5
min = [ 0, 0]
begin
Timeout.timeout(t){
calc_pi(min)
}
rescue Timeout::Error
puts "timeout"
end

printf "%d:...
...Kernel.#openを使用するなどの工夫が必要です。

例 外部コマンドのタイムアウト
require 'timeout'

# テスト用のシェルをつくる。
File
.open("loop.sh", "w"){|fp|
fp.print <<SHELL_EOT
#!/bin/bash

S="scale=10"
M=32767

trap 'echo "$S; $m1/($m1+$m2...

Readline.output=(output) (6238.0)

readline メソッドで使用する出力用の File オブジェクト output を指定します。 戻り値は指定した File オブジェクト output です。

...readline メソッドで使用する出力用の File オブジェクト output を指定します。
戻り値は指定した File オブジェクト output です。

@param output File オブジェクトを指定します。...

Kernel$$DEFAULT_OUTPUT -> IO (6118.0)

$> の別名

...$> の別名

require "English"

dout = $DEFAULT_OUTPUT.dup
$DEFAULT_OUTPUT.reopen("out.txt", "w")
print "foo"
$DEFAULT_OUTPUT.close
$DEFAULT_OUTPUT = dout
p "bar" # => bar
p File.read("out.txt") #=> foo...

Tracer.stdout=(fp) (6106.0)

トレース出力先を変更します。

...トレース出力先を変更します。

@param fp 新しいトレース出力先を指定します。

require 'tracer'

fp = File.open('temptrace.txt', "w")
Tracer.stdout = fp
Tracer.on {
puts "Hello"
}
fp.close...

rubygems/commands/outdated_command (6012.0)

更新が必要な Gem パッケージの一覧を出力するためのライブラリです。

...更新が必要な Gem パッケージの一覧を出力するためのライブラリです。

Usage: gem outdated [options]
Options:
--platform PLATFORM 指定されたプラットフォームに関する情報を表示します
Local/Remote Options:
-l, --local...
...-V, --[no-]verbose 表示を詳細にします
-q, --quiet 静かに実行します
--config-file FILE 指定された設定ファイルを使用します
--backtrace バックトレースを表示します...

絞り込み条件を変える

GC::Profiler.report(out = $stdout) -> nil (3223.0)

GC::Profiler.result の結果を out に出力します。

...GC::Profiler.result の結果を out に出力します。

@param out 結果の出力先を指定します。デフォルトは $stdout です。

//emlist[例][ruby]{
GC::Profiler.enable
GC.start
GC::Profiler.report

# => GC 4 invokes.
# Index Invoke Time(sec) Use Size(byte) Total Si...
...ze(byte) Total Object GC Time(ms)
# 1 0.019 303720 1269840 31746 1.25899999999999967493
//}

@see GC::Profiler.result...
<< 1 2 3 > >>