Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #40239
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <leopardsaga@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.003 |
| X-Spam-Evidence | '*H*': 0.99; '*S*': 0.00; 'win32': 0.03; 'output': 0.04; 'subject:bug': 0.05; '"the': 0.07; 'root,': 0.07; 'python': 0.09; 'internally': 0.09; 'subject:modules': 0.09; 'cc:addr:python-list': 0.10; '2.7.3': 0.16; 'dirs,': 0.16; 'fetches': 0.16; 'filesystem,': 0.16; 'subject: \n ': 0.16; 'wrote:': 0.17; '(or': 0.18; 'email addr:gmail.com>': 0.20; 'equivalent': 0.20; 'bug?': 0.22; 'cheers,': 0.23; 'cc:2**0': 0.23; '>': 0.23; 'dependent': 0.23; 'cc:no real name:2**0': 0.24; 'linux': 0.24; 'allows': 0.25; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'thanks!': 0.26; '(e.g.': 0.27; 'am,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'chris': 0.28; 'cases.': 0.29; 'i/o': 0.29; 'obscure': 0.29; '"the': 0.29; 'maybe': 0.29; 'fri,': 0.30; 'print': 0.32; 'received:74.125.82': 0.33; 'directory,': 0.33; 'docs': 0.33; 'code:': 0.33; 'likely': 0.33; 'received:google.com': 0.34; 'list': 0.35; 'pm,': 0.35; 'subject:?': 0.35; 'but': 0.36; 'received:74.125': 0.36; 'test': 0.36; 'uses': 0.37; 'listing': 0.37; 'subject:: ': 0.38; 'files': 0.38; 'skip:o 20': 0.38; 'performance': 0.39; 'list,': 0.39; 'header:Received:5': 0.40; 'subject:, ': 0.61; 'procedure': 0.61; 'improved': 0.62; 'more': 0.63; 'below:': 0.71; 'lack': 0.71; '2013': 0.84; 'different.': 0.84; 'moral': 0.84; 'abc': 0.91; 'factors': 0.95 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=bJDH+nMnFfIGGCnPwJEhcdUITwWyIh01LOYJ8pPYk+Q=; b=tBCizeMEXvyuu92y2PsM4BmEscvMRV/XJmQ2TsH5ccrV+7yzxdno2gHYVoSyKlEy7t Ru6O3dXLqSQwYND7+473Bp1Dcja5PcELieZQf9vfrtGP2mKL8NymaOftxUZaBEXm+A0L AbS0+E9yngv0+zG9a6VqiqW0/VyBFtBKMlU+bgFlCushLWichhftFmpcF/3Ryty2vTkc 5bgnjTGT7rcupYF4nmrb6hhiTFYPqjASopxar6o5fjf++YWk6E8LRSrI7fqJ3vklKX0C V96Nah9+kU69/spQHgOrZSKOKs2VaSCa3rzy+4EQU8K2t1Rqu/z2H72tazGILbXmkDBL 6XVg== |
| MIME-Version | 1.0 |
| X-Received | by 10.180.75.110 with SMTP id b14mr38334746wiw.21.1362129845308; Fri, 01 Mar 2013 01:24:05 -0800 (PST) |
| In-Reply-To | <CAMZYqRQRRKD2V_X+wRRrJeg9z15tPXTTRr8CY_RB1Ly5dy-DpQ@mail.gmail.com> |
| References | <270cf08f-aefd-436c-a3e6-4adf373d5356@googlegroups.com> <CAMZYqRQRRKD2V_X+wRRrJeg9z15tPXTTRr8CY_RB1Ly5dy-DpQ@mail.gmail.com> |
| Date | Fri, 1 Mar 2013 17:24:05 +0800 |
| Subject | Re: In win32 and linux platform, os modules has diffreent output order, is it a bug? |
| From | Honghe Wu <leopardsaga@gmail.com> |
| To | Chris Rebert <clp2@rebertia.com> |
| Content-Type | multipart/alternative; boundary=f46d043be22891549004d6d99162 |
| Cc | python-list@python.org |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.2711.1362129847.2939.python-list@python.org> (permalink) |
| Lines | 86 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1362129847 news.xs4all.nl 6981 [2001:888:2000:d::a6]:42685 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:40239 |
Show key headers only | View raw
[Multipart message — attachments visible in raw view] - view raw
Thanks! Cause I need sorted returnd list, and the arbitrary list makes the other procedure go wrong. Maybe the I/O speed is more important in other cases. On Mar 1, 2013 4:55 PM, "Chris Rebert" <clp2@rebertia.com> wrote: > On Fri, Mar 1, 2013 at 12:43 AM, Honghe Wu <leopardsaga@gmail.com> wrote: > > env: python 2.7.3 > > > > 6 test files' name in a directory as below: > > 12ab Abc Eab a1bc acd bc > > > > the following is test code: > > for root, dirs, files in os.walk(os.getcwd()): > > print files > > > > the output in win32 platform is: > > ['12ab', 'a1bc', 'Abc', 'acd', 'bc', 'Eab'] > > > > but in linux is: > > ['Eab', 'acd', 'a1bc', '12ab', 'bc', 'Abc' ] > > > > they are so different. a bug? > > Nope. When os.walk() fetches a listing of the contents of a directory, > it internally uses os.listdir() (or a moral equivalent thereof). The > docs for os.listdir() state that "The [returned] list is in arbitrary > order.". The order is dependent on the OS and filesystem, and likely > also more obscure factors (e.g. the order in which the files were > created). The lack of any required ordering allows for improved I/O > performance in many/most cases. > > Cheers, > Chris >
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
In win32 and linux platform, os modules has diffreent output order, is it a bug? Honghe Wu <leopardsaga@gmail.com> - 2013-03-01 00:43 -0800
Re: In win32 and linux platform, os modules has diffreent output order, is it a bug? Benjamin Kaplan <benjamin.kaplan@case.edu> - 2013-03-01 01:01 -0800
Re: In win32 and linux platform, os modules has diffreent output order, is it a bug? Chris Rebert <clp2@rebertia.com> - 2013-03-01 00:55 -0800
Re: In win32 and linux platform, os modules has diffreent output order, is it a bug? Honghe Wu <leopardsaga@gmail.com> - 2013-03-01 17:24 +0800
Re: In win32 and linux platform, os modules has diffreent output order, is it a bug? Nobody <nobody@nowhere.com> - 2013-03-01 12:56 +0000
csiph-web