39件ヒット
[1-39件を表示]
(0.029秒)
検索結果
先頭4件
-
Dir
# children -> [String] (39132.0) -
ディレクトリのファイルエントリ名のうち、 "." と ".." をのぞいた配列を返します。
...ディレクトリのファイルエントリ名のうち、
"." と ".." をのぞいた配列を返します。
@raise IOError 既に self が close している場合に発生します。
//emlist[例][ruby]{
Dir.open('.'){|d|
p d.children # => ["bar", "foo"]
}
//}
@see Dir.children... -
Pathname
# children(with _ directory = true) -> [Pathname] (18208.0) -
self 配下にあるパス名(Pathnameオブジェクト)の配列を返します。
...ith_directory 偽を指定するとファイル名のみ返します。デフォルトは真です。
@raise Errno::EXXX self が存在しないパスであったりディレクトリでなければ例外が発生します。
//emlist[例][ruby]{
require 'pathname'
Pathname.new("/tmp").children #... -
Pathname
# each _ child(with _ directory = true) -> Enumerator (123.0) -
self.children(with_directory).each と同じです。
...self.children(with_directory).each と同じです。
@param with_directory 偽を指定するとファイル名のみ返します。デフォルトは真です。
//emlist[例][ruby]{
require "pathname"
Pathname("/usr/local").each_child {|f| p f }
# => #<Pathname:/usr/local/bin>
# => #<Pathname......al/share>
# => #<Pathname:/usr/local/var>
Pathname("/usr/local").each_child(false) {|f| p f }
# => #<Pathname:bin>
# => #<Pathname:etc>
# => #<Pathname:include>
# => #<Pathname:lib>
# => #<Pathname:opt>
# => #<Pathname:sbin>
# => #<Pathname:share>
# => #<Pathname:var>
//}
@see Pathname#children... -
Pathname
# each _ child(with _ directory = true) {|pathname| . . . } -> [Pathname] (123.0) -
self.children(with_directory).each と同じです。
...self.children(with_directory).each と同じです。
@param with_directory 偽を指定するとファイル名のみ返します。デフォルトは真です。
//emlist[例][ruby]{
require "pathname"
Pathname("/usr/local").each_child {|f| p f }
# => #<Pathname:/usr/local/bin>
# => #<Pathname......al/share>
# => #<Pathname:/usr/local/var>
Pathname("/usr/local").each_child(false) {|f| p f }
# => #<Pathname:bin>
# => #<Pathname:etc>
# => #<Pathname:include>
# => #<Pathname:lib>
# => #<Pathname:opt>
# => #<Pathname:sbin>
# => #<Pathname:share>
# => #<Pathname:var>
//}
@see Pathname#children...