NNTP-Posting-Date: Wed, 28 Sep 2011 09:25:29 -0500 From: "Ste (news)" Subject: Re: OS_GBPB 9 - Read filenames from directory Newsgroups: comp.sys.acorn.programmer Date: Wed, 28 Sep 2011 15:25:26 +0100 Message-ID: <5219d7839bsteve@revi11.plus.com> References: <5218550b41News03@avisoft.f9.co.uk> User-Agent: Pluto/3.04d (RISC-OS/5.17) NewsHound/v1.50-32 Organization: None Lines: 25 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-dAmB0LtZ7twQ4kwyV3f3ANROavnumq+yKKsr6NHJ/+1oZVM7VN9Mv1u7/JMJQjMCqtyNQvhMPK0mq8F!5q0ZNTOutcR93yb21u7oh58uAIct4JqXd8Gblrfcu/YfQ+UDuEbP0w55iohzET7d1HshJ2nUbJ8B!3w== X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 1981 Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.stben.net!border3.nntp.ams.giganews.com!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail Xref: x330-a1.tempe.blueboxinc.net comp.sys.acorn.programmer:791 In article <5218550b41News03@avisoft.f9.co.uk>, Martin wrote: > The SWI OS_GBPB,9-12 can be used for reading a list of file names from a > directory. The PRM page 2-70 makes no mention of the sequence in which > the files are returned, so it must presumably be assumed that they will > be in an indeterminate sequence. Correct. The objects are returned in whatever order the underlying file system feels like. For FileCore-based file systems, this happens to be alphabetical (ASCII) order. For network file systems (LanMan, NFS, etc) and others (HostFS, etc) you'll probably get them in some other order. This is a PITA, because you need to make a number of calls to GBPB (if you're iterating over everything) and add all of the objects to a list which you then have to sort later. It would've been nice if the OS presented a call to do that for you, instead of umpteen developers re-inventing that wheel over the years... Ta, Steve -- Steve Revill @ Home Note: All opinions expressed herein are my own.