るりまサーチ

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

別のキーワード

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

モジュール

キーワード

検索結果

<< < 1 2 3 4 5 > >>

IO#each_char {|c| ... } -> self (6121.0)

self に含まれる文字を一文字ずつブロックに渡して評価します。

...ません。

ブロックを省略した場合は各文字について繰り返す Enumerator を返します。

@raise IOError self が読み込み用にオープンされていない場合に発生します。

f = File.new("testfile")
f.each_char {|c| print c, ' ' } #=> #<File:testfile>...

Shell#foreach(path = nil, &block) -> () (6117.0)

pathがファイルなら, File#foreach pathがディレクトリなら, Dir#foreach の動作をします。

...ァイルなら, File#foreach
pathがディレクトリなら, Dir#foreach
の動作をします。

@param path ファイルもしくはディレクトリのパスを文字列で指定します。

使用例
require 'shell'
Shell.verbose = false
sh = Shell.new
sh.foreach("/tmp"){|f|
put...

Shell::CommandProcessor#foreach(path = nil, &block) -> () (6117.0)

pathがファイルなら, File#foreach pathがディレクトリなら, Dir#foreach の動作をします。

...ァイルなら, File#foreach
pathがディレクトリなら, Dir#foreach
の動作をします。

@param path ファイルもしくはディレクトリのパスを文字列で指定します。

使用例
require 'shell'
Shell.verbose = false
sh = Shell.new
sh.foreach("/tmp"){|f|
put...

Shell::Filter#foreach(path = nil, &block) -> () (6117.0)

pathがファイルなら, File#foreach pathがディレクトリなら, Dir#foreach の動作をします。

...ァイルなら, File#foreach
pathがディレクトリなら, Dir#foreach
の動作をします。

@param path ファイルもしくはディレクトリのパスを文字列で指定します。

使用例
require 'shell'
Shell.verbose = false
sh = Shell.new
sh.foreach("/tmp"){|f|
put...

IO#each_byte -> Enumerator (6115.0)

IO の現在位置から 1 バイトずつ読み込み、それを整数として与え、ブロックを実行します。

...み込みメソッドとして動作します。

@raise IOError 自身が読み込み用にオープンされていなければ発生します。

//emlist[例][ruby]{
IO.write("testfile", "aあ")
File
.open("testfile") do |io|
io.each_byte { |x| p x }
# => 97
# 227
# 129
# 130
end
//}...

絞り込み条件を変える

IO#each_byte {|ch| ... } -> self (6115.0)

IO の現在位置から 1 バイトずつ読み込み、それを整数として与え、ブロックを実行します。

...み込みメソッドとして動作します。

@raise IOError 自身が読み込み用にオープンされていなければ発生します。

//emlist[例][ruby]{
IO.write("testfile", "aあ")
File
.open("testfile") do |io|
io.each_byte { |x| p x }
# => 97
# 227
# 129
# 130
end
//}...

IO#each_codepoint -> Enumerator (6115.0)

IO の各コードポイントに対して繰り返しブロックを呼びだします。

...にはコードポイントを表す整数が渡されます。

ブロックを省略した場合には、Enumerator を返します。

//emlist[例][ruby]{
IO.write("testfile", "abcdeあ")
File
.open("testfile") do |f|
f.each_codepoint { |i| p i }
end
# => 97
# 98
# 99
# 100
# 101
# 12354
//}...

IO#each_codepoint {|c| ... } -> self (6115.0)

IO の各コードポイントに対して繰り返しブロックを呼びだします。

...にはコードポイントを表す整数が渡されます。

ブロックを省略した場合には、Enumerator を返します。

//emlist[例][ruby]{
IO.write("testfile", "abcdeあ")
File
.open("testfile") do |f|
f.each_codepoint { |i| p i }
end
# => 97
# 98
# 99
# 100
# 101
# 12354
//}...

Shell#tee(file) -> Shell::Filter (144.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...am file シェルコマンドtee に与えるファイル名を文字列で指定します。

動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file
.chomp!
cat(file).each { |l|
echo(l) | tee(file...

Shell::CommandProcessor#tee(file) -> Shell::Filter (144.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...am file シェルコマンドtee に与えるファイル名を文字列で指定します。

動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file
.chomp!
cat(file).each { |l|
echo(l) | tee(file...

絞り込み条件を変える

Shell::Filter#tee(file) -> Shell::Filter (144.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...am file シェルコマンドtee に与えるファイル名を文字列で指定します。

動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file
.chomp!
cat(file).each { |l|
echo(l) | tee(file...

Shell#cat(*files) -> Shell::Filter (137.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...m files シェルコマンド cat に与えるファイル名を文字列で指定します。

動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file
.chomp!
cat(file).each { |l|
echo(l) | tee(file...
<< < 1 2 3 4 5 > >>