diff --git a/lib/fileutils.rb b/lib/fileutils.rb index dc72618..2b02c54 100644 --- a/lib/fileutils.rb +++ b/lib/fileutils.rb @@ -1274,8 +1274,15 @@ def door? def entries opts = {} opts[:encoding] = ::Encoding::UTF_8 if fu_windows? - Dir.children(path, opts)\ - .map {|n| Entry_.new(prefix(), join(rel(), n.untaint)) } + + files = if Dir.respond_to?(:children) + Dir.children(path, opts) + else + Dir.entries(path(), opts) + .reject {|n| n == '.' or n == '..' } + end + + files.map {|n| Entry_.new(prefix(), join(rel(), n.untaint)) } end def stat