ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: eregontp@gmail.com
To: ruby-core@ruby-lang.org
Subject: [ruby-core:96851] [Ruby master Feature#8709] Dir.glob should return sorted file list
Date: Tue, 14 Jan 2020 10:44:38 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-83856.20200114104437.5a8074f5d916747f@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-8709.20130731012405@ruby-lang.org

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


Even C's glob(3) is sorted (by default), as @bmwiedemann said:

```
$ man 3 glob
...
       GLOB_NOSORT
              Don't sort the returned pathnames.  The only reason to do this is to save processing time.  By default, the returned path‐
              names are sorted.
```

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

* 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/

  parent reply	other threads:[~2020-01-14 10:44 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-30 16:24 [ruby-core:56274] [ruby-trunk - Bug #8709][Open] Dir.glob should return sorted file list tommorris (Tom Morris)
2013-07-30 17:49 ` [ruby-core:56275] [ruby-trunk - Bug #8709][Rejected] " charliesome (Charlie Somerville)
2020-01-11  6:28 ` [ruby-core:96776] [Ruby master Bug#8709] " rubybugsbmw
2020-01-11 11:18 ` [ruby-core:96779] " hsbt
2020-01-11 11:27 ` [ruby-core:96780] [Ruby master Feature#8709] " eregontp
2020-01-11 11:32 ` [ruby-core:96781] " hsbt
2020-01-11 11:33 ` [ruby-core:96782] " eregontp
2020-01-11 11:35 ` [ruby-core:96785] " eregontp
2020-01-11 20:48 ` [ruby-core:96792] " rubybugsbmw
2020-01-13  9:28 ` [ruby-core:96823] " jean.boussier
2020-01-13 10:04 ` [ruby-core:96824] " deivid.rodriguez
2020-01-13 18:49 ` [ruby-core:96828] " john
2020-01-14  6:27 ` [ruby-core:96836] " naruse
2020-01-14  7:27 ` [ruby-core:96840] " mame
2020-01-14 10:40 ` [ruby-core:96850] " eregontp
2020-01-14 10:44 ` eregontp [this message]
2020-01-16  5:22 ` [ruby-core:96882] " nobu
2020-01-16  6:03 ` [ruby-core:96888] " matz
2020-01-16 15:12 ` [ruby-core:96911] " daniel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-83856.20200114104437.5a8074f5d916747f@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).