From: eregontp@...
Date: 2020-01-11T11:27:54+00:00
Subject: [ruby-core:96780] [Ruby master Feature#8709] Dir.glob should return	sorted file list

Issue #8709 has been updated by Eregon (Benoit Daloze).

ruby -v deleted (ruby 1.9.3p429 (2013-05-15) [x86_64-linux] Brightbox)
Status changed from Rejected to Open
Tracker changed from Bug to Feature

I agree always sorting the result of `Dir.glob` makes sense.
Non-determinism caused by Dir.glob is very annoying and IMHO doesn't feel like Ruby.
I would also expect sorting is a low overhead compared to syscalls, so performance-wise I think it's not a big hit.

FWIW, TruffleRuby currently returns sorted results for `Dir.glob`.

hsbt (Hiroshi SHIBATA) wrote:
> Do not update the `status` without a maintainer's decision.

How should we rediscuss this then?
It's not because the documentation mentions it we should never change it.
I'll reopen as a Feature.

----------------------------------------
Feature #8709: Dir.glob should return sorted file list
https://bugs.ruby-lang.org/issues/8709#change-83773

* Author: tommorris (Tom Morris)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
On OS X, Dir.glob and Dir[] return an ordered list of files.

On Ubuntu Linux, they do not and one must manually sort them.

Returning a list of files that isn't in order fails the Principle of Least Astonishment.

I attach a unit test to demonstrate ideal behaviour.

---Files--------------------------------
globtest.rb (454 Bytes)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>