[Oberon] Fwd: IDE with integrated source level debuggerandLuaJIT VM running the Oberon System

Michael Schierl schierlm at gmx.de
Sun Feb 16 13:09:17 CET 2020


Am 16.02.2020 um 01:44 schrieb rochus.keller at bluewin.ch:

> It fixes a crash detected by Michael Schierl and adds a first implementation of FileDir.Enumerate so System.Directory does something (although I'm not sure yet how the prefix mechanism is supposed to work).

As the directory index in the Oberon filesystem is a B-Tree, the prefix
is used to optimize the scanning to only look at pages that may contain
the given prefix.

So when you pass a prefix of "X", you will receive files "XY.Mod" or
"X.Mod" or "X", but not "Y.Mod" or "Files.Mod". A prefix of "" will
return all files.

So when you call System.Directory for XY*Z*.Mod, it will pass "XY" as
prefix to speed up the search. When searching for "*.Mod", the prefix
will be empty and no speedup can occur.

Implementations of FileDir.Enumerate are free to ignore the prefix, as
the only caller in System.Mod will validate the whole filename
afterwards anyway. In case the API you are using supports prefixes or
globs (like FindFirstFile on Windows or glob(3) on Unix), you can of
course pass the prefix too, to make the search faster.


Regards,


Michael




More information about the Oberon mailing list