From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 912121F46C for ; Sat, 11 Jan 2020 20:48:15 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id DF900120A27; Sun, 12 Jan 2020 05:48:01 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id 086F6120A26 for ; Sun, 12 Jan 2020 05:47:59 +0900 (JST) Received: by filterdrecv-p3mdw1-56c97568b5-9vfcv with SMTP id filterdrecv-p3mdw1-56c97568b5-9vfcv-17-5E1A3485-15 2020-01-11 20:48:05.541160136 +0000 UTC m=+2232294.163723034 Received: from herokuapp.com (unknown [54.224.129.129]) by ismtpd0084p1mdw1.sendgrid.net (SG) with ESMTP id pFxzlU2nT3W3-XlZfwJalA for ; Sat, 11 Jan 2020 20:48:05.355 +0000 (UTC) Date: Sat, 11 Jan 2020 20:48:05 +0000 (UTC) From: rubybugsbmw@lsmod.de Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 72455 X-Redmine-Project: ruby-master X-Redmine-Issue-Id: 8709 X-Redmine-Issue-Author: tommorris X-Redmine-Sender: bmwiedemann X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?JlfKNbP8NN3QYirIjBrztxWGKnkAiLNNKowP7fMesA0wHXWbkWSNFfW4Kd9T3e?= =?us-ascii?Q?gcINb6IsPSN7F1B14oHe=2F35tlWMbHzdxw0ul15Q?= =?us-ascii?Q?vedgPz+6WYVLSTuZX4LjXX85mKxQG1Wu40Qw8Hp?= =?us-ascii?Q?oHcz57w=2FmeLhBrf=2FuUfMwZJbi63OnfFMwicGY+M?= =?us-ascii?Q?x43yNqmpxJlDOAN5mcDmPzIBfXE4yYfLwewV2uE?= =?us-ascii?Q?zvlF04Btxg+nwzs4c=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 96792 Subject: [ruby-core:96792] [Ruby master Feature#8709] Dir.glob should return sorted file list X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" 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/