Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.acorn.programmer > #5468

Re: Using results of a directory cataloguing

From druck <news@druck.org.uk>
Newsgroups comp.sys.acorn.programmer
Subject Re: Using results of a directory cataloguing
Date 2018-06-12 18:25 +0100
Organization A noiseless patient Spider
Message-ID <pfovmc$4pl$1@dont-email.me> (permalink)
References <2b768c7d-683e-4ccd-bb16-dae46badf4a6@googlegroups.com> <acecd7c9-5270-44b5-89d2-4d86775aff68@googlegroups.com>

Show all headers | View raw


On 12/06/2018 10:55, jgh@mdfs.net wrote:
> It's risky to demand all the filenames in a directory all at once
> (on any system) as you don't know beforehand how many you'll get,
> so could potentially fetch four billion filenames. It's best to
> get them one at a time and do whatever processing you want to do
> on each one as you go.

Attempting to reading all entries is perfectly OK, as long as...

> The following is portable across any platform with an Acorn/BBC API:
> http://beebwiki.mdfs.net/Scanning_Directories_(Reading_Directory_Entries)

...you use a sensible API. The above is the old Beeb style and shouldn't 
be used by any new code. Instead see:-

https://www.riscosopen.org/wiki/documentation/show/OS_GBPB

Use reason code 9,10,11 or 12 to read entries into a buffer of size you 
specify. If its big enough it will get all entries in one go. (Don't use 
8 as you can't specify the size).

Of course if the buffer isn't big enough, you need to repeat the call 
until all entries are read. To simplify matters people often only use a 
buffer large enough for one entry, and always repeat the call.

---druck

Back to comp.sys.acorn.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Using results of a directory cataloguing xltardy@gmail.com - 2018-06-10 20:13 -0700
  Re: Using results of a directory cataloguing "John Williams (News)" <UCEbin@tiscali.co.uk> - 2018-06-11 08:38 +0100
    Re: Using results of a directory cataloguing Alan Adams <alan@adamshome.org.uk> - 2018-06-11 10:20 +0100
  Re: Using results of a directory cataloguing jgh@mdfs.net - 2018-06-12 02:55 -0700
    Re: Using results of a directory cataloguing Martin <News03@avisoft.f9.co.uk> - 2018-06-12 13:34 +0100
    Re: Using results of a directory cataloguing druck <news@druck.org.uk> - 2018-06-12 18:25 +0100
      Re: Using results of a directory cataloguing xltardy@gmail.com - 2018-06-15 21:04 -0700
      Re: Using results of a directory cataloguing xltardy@gmail.com - 2018-06-15 21:20 -0700

csiph-web