7件ヒット
[1-7件を表示]
(0.105秒)
クラス
-
File
:: Stat (1) - Pathname (5)
モジュール
- Kernel (1)
キーワード
- children (1)
- directory? (2)
-
each
_ child (2) -
relative
_ path _ from (1)
検索結果
先頭5件
-
Kernel
# directory(dir) -> () (54643.0) -
与えられたディレクトリを作成するタスクを定義します。
与えられたディレクトリを作成するタスクを定義します。
@param dir 作成するディレクトリを指定します。
例:
directory 'testdata/doc' -
Pathname
# directory? -> bool (18691.0) -
FileTest.directory?(self.to_s) と同じです。
FileTest.directory?(self.to_s) と同じです。
@see FileTest.#directory? -
File
:: Stat # directory? -> bool (18661.0) -
ディレクトリの時に真を返します。
ディレクトリの時に真を返します。
//emlist[][ruby]{
p File::Stat.new($0).directory? #=> false
//}
@see FileTest.#directory? -
Pathname
# each _ child(with _ directory = true) -> Enumerator (1000.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:/usr/local/etc>
# => #<Pathname:/usr/local/include>
# => #<Pathname:/us... -
Pathname
# each _ child(with _ directory = true) {|pathname| . . . } -> [Pathname] (1000.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:/usr/local/etc>
# => #<Pathname:/usr/local/include>
# => #<Pathname:/us... -
Pathname
# relative _ path _ from(base _ directory) -> Pathname (781.0) -
base_directory から self への相対パスを求め、その内容の新しい Pathname オブジェクトを生成して返します。
base_directory から self への相対パスを求め、その内容の新しい Pathname
オブジェクトを生成して返します。
パス名の解決は文字列操作によって行われ、ファイルシステムをアクセス
しません。
self が相対パスなら base_directory も相対パス、self が絶対パスなら
base_directory も絶対パスでなければなりません。
@param base_directory ベースディレクトリを表す Pathname オブジェクトを指定します。
@raise ArgumentError Windows上でドライブが違うなど、base_direct... -
Pathname
# children(with _ directory = true) -> [Pathname] (661.0) -
self 配下にあるパス名(Pathnameオブジェクト)の配列を返します。
self 配下にあるパス名(Pathnameオブジェクト)の配列を返します。
ただし、 ".", ".." は要素に含まれません。
@param with_directory 偽を指定するとファイル名のみ返します。デフォルトは真です。
@raise Errno::EXXX self が存在しないパスであったりディレクトリでなければ例外が発生します。
//emlist[例][ruby]{
require 'pathname'
Pathname.new("/tmp").children # => [#<Pathname:.X11-unix>, #<Pathname:.iroha_unix>...