るりまサーチ (Ruby 2.6.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.024秒)
トップページ > バージョン:2.6.0[x] > クエリ:Dir.empty?[x] > 種類:特異メソッド[x]

別のキーワード

  1. argf.class lines
  2. argf.class each
  3. argf.class each_line
  4. argf.class to_a
  5. argf.class gets

ライブラリ

クラス

検索結果

Dir.empty?(path_name) -> bool (186412.0)

path_name で与えられたディレクトリが空の場合に真を返します。 ディレクトリでない場合や空でない場合に偽を返します。

path_name で与えられたディレクトリが空の場合に真を返します。
ディレクトリでない場合や空でない場合に偽を返します。

//emlist[例][ruby]{
Dir.empty?('.') #=> false
Dir.empty?(IO::NULL) #=> false
require 'tmpdir'
Dir.mktmpdir { |dir| Dir.empty?(dir) } #=> true
//}

@param path_name 確認したいディレクトリ名。