ライブラリ
- ビルトイン (149)
- pathname (22)
- shell (6)
-
shell
/ command-processor (6) -
shell
/ filter (6)
クラス
- Dir (149)
- Pathname (22)
- Shell (6)
-
Shell
:: CommandProcessor (6) -
Shell
:: Filter (6)
検索結果
先頭5件
-
Shell
# open(path , mode) -> File | Dir (18269.0) -
path がファイルなら、 File.open path がディレクトリなら、 Dir.open の動作をします。
...がファイルなら、 File.open path がディレクトリなら、 Dir.open の動作をします。
@param path 開きたいパスを指定します。
@param mode アクセスモードを指定します。path がディレクトリの場合は無視されます。
@see File.open, Dir.open... -
Shell
:: CommandProcessor # open(path , mode) -> File | Dir (18269.0) -
path がファイルなら、 File.open path がディレクトリなら、 Dir.open の動作をします。
...がファイルなら、 File.open path がディレクトリなら、 Dir.open の動作をします。
@param path 開きたいパスを指定します。
@param mode アクセスモードを指定します。path がディレクトリの場合は無視されます。
@see File.open, Dir.open... -
Shell
:: Filter # open(path , mode) -> File | Dir (18269.0) -
path がファイルなら、 File.open path がディレクトリなら、 Dir.open の動作をします。
...がファイルなら、 File.open path がディレクトリなら、 Dir.open の動作をします。
@param path 開きたいパスを指定します。
@param mode アクセスモードを指定します。path がディレクトリの場合は無視されます。
@see File.open, Dir.open... -
Pathname
# opendir -> Dir (12347.0) -
Dir.open(self.to_s, &block) と同じです。
...Dir.open(self.to_s, &block) と同じです。
@see Dir.open... -
Pathname
# opendir {|dir| . . . } -> nil (12347.0) -
Dir.open(self.to_s, &block) と同じです。
...Dir.open(self.to_s, &block) と同じです。
@see Dir.open... -
Dir
# pos=(pos) (9035.0) -
ディレクトリストリームの読み込み位置を pos に移動させます。 pos は Dir#tell で与えられた値でなければなりま せん。
...動させます。
pos は Dir#tell で与えられた値でなければなりま
せん。
@param pos 変更したい位置を整数で与えます。
@raise IOError 既に自身が close している場合に発生します。
//emlist[例][ruby]{
Dir.open("testdir") do |d|
d.read......# => "."
i = d.tell # => 12
d.read # => ".."
d.seek(i) # => #<Dir:0x401b3c40>
d.read # => ".."
end
//}... -
Dir
# seek(pos) -> self (9035.0) -
ディレクトリストリームの読み込み位置を pos に移動させます。 pos は Dir#tell で与えられた値でなければなりま せん。
...動させます。
pos は Dir#tell で与えられた値でなければなりま
せん。
@param pos 変更したい位置を整数で与えます。
@raise IOError 既に自身が close している場合に発生します。
//emlist[例][ruby]{
Dir.open("testdir") do |d|
d.read......# => "."
i = d.tell # => 12
d.read # => ".."
d.seek(i) # => #<Dir:0x401b3c40>
d.read # => ".."
end
//}... -
Dir
# read -> String | nil (9031.0) -
ディレクトリストリームから次の要素を読み出して返します。最後の要素 まで読み出していれば nil を返します。
...場合に発生します。
//emlist[例][ruby]{
require 'tmpdir'
Dir.mktmpdir do |tmpdir|
File.open("#{tmpdir}/test1.txt", "w") { |f| f.puts("test1") }
File.open("#{tmpdir}/test2.txt", "w") { |f| f.puts("test2") }
Dir.open(tmpdir) do |d|
p d.read # => "."
p d.read # => ".."... -
Dir
# each _ child -> Enumerator (9025.0) -
ディレクトリの "." と ".." をのぞく各エントリを表す文字列を引数として、 ブロックを評価します。
...合、各エントリを文字列として保持する
Enumerator
オブジェクトを返します。
@raise IOError 既に self が close している場合に発生します。
//emlist[例][ruby]{
Dir.open('.').each_child{|f|
p f
}
#=> "bar"
# "foo"
//}
@see Dir#each
@see Dir.each_child... -
Dir
# each _ child {|item| . . . } -> self (9025.0) -
ディレクトリの "." と ".." をのぞく各エントリを表す文字列を引数として、 ブロックを評価します。
...合、各エントリを文字列として保持する
Enumerator
オブジェクトを返します。
@raise IOError 既に self が close している場合に発生します。
//emlist[例][ruby]{
Dir.open('.').each_child{|f|
p f
}
#=> "bar"
# "foo"
//}
@see Dir#each
@see Dir.each_child... -
Dir
# children -> [String] (9019.0) -
ディレクトリのファイルエントリ名のうち、 "." と ".." をのぞいた配列を返します。
...ディレクトリのファイルエントリ名のうち、
"." と ".." をのぞいた配列を返します。
@raise IOError 既に self が close している場合に発生します。
//emlist[例][ruby]{
Dir.open('.'){|d|
p d.children # => ["bar", "foo"]
}
//}
@see Dir.children... -
Dir
# each -> Enumerator (9019.0) -
ディレクトリの各エントリを表す文字列を引数として、ブロックを評価します。
...場合、各エントリを文字列として保持する
Enumerator
オブジェクトを返します。
@raise IOError 既に自身が close している場合に発生します。
//emlist[例][ruby]{
Dir.open('.').each{|f|
p f
}
#=> "."
# ".."
# "bar"
# "foo"
//}
@see Dir#each_child... -
Dir
# each {|item| . . . } -> self (9019.0) -
ディレクトリの各エントリを表す文字列を引数として、ブロックを評価します。
...場合、各エントリを文字列として保持する
Enumerator
オブジェクトを返します。
@raise IOError 既に自身が close している場合に発生します。
//emlist[例][ruby]{
Dir.open('.').each{|f|
p f
}
#=> "."
# ".."
# "bar"
# "foo"
//}
@see Dir#each_child...