Forum: Ruby-core [ruby-trunk - Bug #8709][Open] Dir.glob should return sorted file list

3e00403e6a08fc4499057d8be5b85709?d=identicon&s=25 tommorris (Tom Morris) (Guest)
on 2013-07-30 18:24
(Received via mailing list)
Issue #8709 has been reported by tommorris (Tom Morris).

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

Author: tommorris (Tom Morris)
Status: Open
Priority: Normal
Assignee:
Category:
Target version:
ruby -v: ruby 1.9.3p429 (2013-05-15) [x86_64-linux] Brightbox
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


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.
F736999f7c1b7a87a100faa112bbc0f3?d=identicon&s=25 charliesome (Charlie Somerville) (Guest)
on 2013-07-30 19:50
(Received via mailing list)
Issue #8709 has been updated by charliesome (Charlie Somerville).

Status changed from Open to Rejected

=begin
Dir.glob is documented to return filenames in filesystem order:

> Note that case sensitivity depends on your system, ((*as does the order in which
the results are returned.*))
=end

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

Author: tommorris (Tom Morris)
Status: Rejected
Priority: Normal
Assignee:
Category:
Target version:
ruby -v: ruby 1.9.3p429 (2013-05-15) [x86_64-linux] Brightbox
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


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.
This topic is locked and can not be replied to.