Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

CatSearchMBS class

Type Topic Plugin Version macOS Windows Linux Console & Web iOS
class Catalog Search MBS MacClassic Plugin Yes No No Yes, macOS only No
Function: Allows you to search fast on your harddisk.
Example:
dim cs as new CatSearchMBS

if cs.Search(volume(0), true) then

// set search params

cs.Name = "REALbasic"
cs.PartialName = true

dim response as Integer
do
response = cs.SearchNext
if response = 0 then // still searching

if cs.Result<>nil then // did we find something?
Listbox1.AddRow cs.Result.Name

if Listbox1.ListCount = 100 then
Return // stop after 100 entries
end if
end if

end
loop until response < 0
end if
Notes:
Depending on what and how you want to search, you can decide whether MDQueryMBS or CatSearchMBS is the better choice.

This class implements the PBCatSearch function of the Mac OS File Manager. This is a very fast routine to find specific types of files on a volume. The MacOS tool Sherlock (aka Find File) uses this function to its quick search on local volumes.

There are some restrictions to CatSearchMBS: Is it not supported on every volume! Whether it is supported or not depents on the File System format used on the Volume: HFS, HFS+ and most File Servers support it, while Floppy Disks, ISO 9660 and UDF formatted disks, used on some CDs and on most DVD-ROMs, might not support it.

This version of this plugin can now handle those cases where CatSearchMBS is not supported, too: If a volume does not support CatSearchMBS, you can choose to fall back to the classic recursive directory search, which is much slower, but gives you the same results.

(This new feature is achieved by using a C library called "MoreFiles", written by Jim Luther, one of Apple's File System "gurus".)

Feedback, Comments & Corrections

This class has no sub classes.

Some examples which use this class:


The items on this page are in the following plugins: MBS MacClassic Plugin.


CATransactionMBS   -   CBATTRequestMBS




Links
MBS Xojo Plugins