るりまサーチ

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

別のキーワード

  1. openssl g
  2. openssl g=
  3. dh g
  4. dsa g
  5. dh g=

ライブラリ

キーワード

検索結果

Dir#children -> [String] (102.0)

ディレクトリのファイルエントリ名のうち、 "." と ".." をのぞいた配列を返します。

...ディレクトリのファイルエントリ名のうち、
"." と ".." をのぞいた配列を返します。

@raise IOError 既に self が close している場合に発生します。

//emlist[例][ruby]{
Dir
.open('.'){|d|
p d.children # => ["bar", "foo"]
}
//}

@see Dir.children...

Dir#fileno -> Integer (102.0)

self に関連づけられたファイル記述子を表す整数を返します。

...を表す整数を返します。

//emlist[例][ruby]{
Dir
.open("..") { |d| d.fileno } # => 8
//}

本メソッドでは POSIX 2008 で定義されている dirfd() 関数を使用します。

@raise NotImplementedError Windows などの dirfd() 関数が存在しないプラッ...

Dir#inspect -> String (102.0)

self の情報を人間に読みやすい文字列にして返します。

...self の情報を人間に読みやすい文字列にして返します。

//emlist[例][ruby]{
Dir
.open("/") { |d| d.inspect } # => "#<Dir:/>"
//}...

Dir#path -> String (102.0)

オープンしているディレクトリのパス名を文字列で返します。

...オープンしているディレクトリのパス名を文字列で返します。

//emlist[例][ruby]{
Dir
.open("..") do |d|
d.path # => ".."
d.to_path # => ".."
end
//}...

Dir#pos -> Integer (102.0)

ディレクトリストリームの現在の位置を整数で返します。

...ディレクトリストリームの現在の位置を整数で返します。

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

//emlist[例][ruby]{
Dir
.open("/tmp") {|d|
d.each {|f|
p d.pos
}
}
//}...

絞り込み条件を変える

Dir#read -> String | nil (102.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#tell -> Integer (102.0)

ディレクトリストリームの現在の位置を整数で返します。

...ディレクトリストリームの現在の位置を整数で返します。

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

//emlist[例][ruby]{
Dir
.open("/tmp") {|d|
d.each {|f|
p d.pos
}
}
//}...

Dir#to_path -> String (102.0)

オープンしているディレクトリのパス名を文字列で返します。

...オープンしているディレクトリのパス名を文字列で返します。

//emlist[例][ruby]{
Dir
.open("..") do |d|
d.path # => ".."
d.to_path # => ".."
end
//}...