Task/Empty-directory/Ruby/empty-directory-2.rb
# Checks if a directory is empty, but raises SystemCallError
# if _path_ is not a directory.
Checks if a directory is empty, but raises SystemCallError
if _path_ is not a directory.
Checks if a directory is empty but raises SystemCallError if _path_ is not a directory .
def empty_dir?(path)
  Dir.foreach(path) {|f|
    return false if f != '.' and f != '..'
  }
  return true
end
def empty_dir? ( path ) Dir . foreach ( path ) { | f | return false if f != '.' and f != '..' } return true end
Checks if a directory is empty, but raises SystemCallError
if _path_ is not a directory.
Checks if a directory is empty but raises SystemCallError if _path_ is not a directory .
path
<not_specific>