[ruby-core:96792] [Ruby master Feature#8709] Dir.glob should return sorted file list
[email protected] Sat, 11 Jan 2020 20:48:05 +0000 (UTC)
| Newsgroups | gmane.comp.lang.ruby.core |
|---|---|
| Message-ID | <redmine.journal-83786.20200111204805.14d3c16812fca1b2@ruby-lang.org> |
Issue #8709 has been updated by bmwiedemann (Bernhard M. Wiedemann). The benchmark numbers above show a difference of 12% That is probably the worst case, because usually, globs will return fewer entries (though for some strange reason I get a 20% diff on a dir with 200 entries) and usually some processing will be performed on the returned files and that will take much longer than the sorting. ---------------------------------------- Feature #8709: Dir.glob should return sorted file list https://bugs.ruby-lang.org/issues/8709#change-83786 * 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:[email protected]?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>