From owner-freebsd-hardware Thu Apr 4 09:19:06 1996 Return-Path: owner-hardware Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id JAA11784 for hardware-outgoing; Thu, 4 Apr 1996 09:19:06 -0800 (PST) Received: from lserver.infoworld.com (lserver.infoworld.com [192.216.48.4]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id JAA11762 for ; Thu, 4 Apr 1996 09:19:03 -0800 (PST) Received: from ccgate.infoworld.com by lserver.infoworld.com with smtp (Smail3.1.29.1 #12) id m0u4sgl-000wyKC; Thu, 4 Apr 96 09:19 PST Received: from cc:Mail by ccgate.infoworld.com id AA828638254; Thu, 04 Apr 96 09:56:08 PST Date: Thu, 04 Apr 96 09:56:08 PST From: "Brett Glass" Message-Id: <9603048286.AA828638254@ccgate.infoworld.com> To: Michael Smith Cc: msmith@atrad.adelaide.edu.au, jkh@time.cdrom.com, hardware@freebsd.org Subject: Re: Some solutions to disk problems.... I think. Sender: owner-hardware@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > Here's a suggestion. Write a function that performs simple string > matching using a table of ten IDs. Write ten functions which each parse > for these ID's. Compare the size of the two. Repeat the process for > twenty, and so on. I hope you are jesting! Only the most abysmal programmer would have to write ten functions to replace ten table entries. As the number of drives increases, code gains a greater and greater advantage as it is able to parse prefixes, suffixes, and partial model numbers for groups of drives. If the SCSI code really has to use a wildcard parser, it might actually be WORTH considering doing a shared regular expression parser (wildcards are a bit weak for the task). Regular expressions are, in a sense, programs. Seagate alone has several HUNDRED model numbers. In my hard disk guide, they go on for PAGES in fine print. And that's just one brand. Recognizing substrings of different lengths, and knowing when to look for suffixes as well as the corresponding CDC and Conner model numbers, will be key to identifying drives efficiently. --Brett