[futurebasic] Re: High Speed File Finding

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 1999 : Group Archive : Group : All Groups

From: Herbie Glunder <H.Gluender@...>
Date: Thu, 07 Oct 1999 12:03:02 +0200
Mel Patrick wrote:

>I'm reasonably sure that this was discussed not too long ago so
humour my sleight of mind, but whats the fastest way to look through
a drive(s) to locate a "given" filename (no pathname or fSpec) and
then return all the matches?

>i.e. do a find for a filename called "WheredMelLeaveIt" that was say
created on a specific date (maybe even match a type and creator).

>The date might be handy so I can sort them from newest to oldest. It
would be nice to get either a pathname or fSpec back that I could
open.

>Anyone? Is this something that could be done by searching the desktop
database? Or?

-----------------------------------------------------------------------------

There is a fine solution to your problem called

' FN catSearch.BAS
' A recursive cat search for
' mini-runtime applications and/or
' code resources.

written by

' by R.W. Lambert & Mel Patrick
' Copyright © 1995
' Ariel Publishing, Inc.

which has the advantage to also run under pre-OS 7 systems. You will
find it on the FB^3 pre-release CD in the Folder "Function Libraries ƒ"
which is in the Folder "FJ2" and I am sure you will find it on the
actual Function Junction CD. The program works fine but is limited in
speed.
-----------------------------------------------------------------------------

A post-OS 7 solution, that should be much faster, involves the use of
the Apple Toolbox Call

ToolBox FN PBCatSearchSync(long) = word `0x205F,0x7018,0xA260,0x3E80

that is contained in FB^3 Tlbx Standard.Incl. and is well described in
InsideMacintosh/Files. There you will find a Pascal example of how to
use this call. It is claimed to be more then 10 times faster than the
explicit recursive algorithm.

Presently, I struggle with the application of this call under FB II,
especially with the variables in the HParamBlock that partially are of
the byte type not directly supported under FB II.
-----------------------------------------------------------------------------

I am sure the search can also be performed by use of Sherlock. But I
have no experience with it and, as far as I know, it is not available
under OS 7.x.

Good luck!

Herbie
********************************
(H.Glunder@...)