Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!apple!oliveb!amiga!cbmvax!peter From: peter@cbmvax.UUCP (Peter Cherna) Newsgroups: comp.sys.amiga Subject: Re: AmigaDos directory knowledge Message-ID: <8713@cbmvax.UUCP> Date: 26 Nov 89 19:11:25 GMT References: <291@intersil.uucp> Reply-To: peter@cbmvax.UUCP (Peter Cherna) Organization: Commodore Technology, West Chester, PA Lines: 40 In article <291@intersil.uucp> hamilton@intersil.uucp (Fred Hamilton) writes: >.....................................................C<................ > >I just remembered a question I've had since WorkBench 1.0. When you type >a command like: > > List c:edd ;(A typo, for instance) > >You get an (almost) instant response of "object not found". >But if you type: > > List c:ed#? > >The OS thrashes throught the entire directory before giving you the list. > >What's happening here? If you ask for a file by name, the OS looks for it by name, and through the magic of hash tables very quickly finds out where that file is, or alternately that that file isn't. If you ask for a file by pattern, the OS has no better way than to check each possible file for a match. Imagine if I asked you to tell me if there was anybody in the phone book with the last name of "Cherna". How long would it take you? Now I'll ask you how many people in the phone book have last names which end in "erna". Let me know when you're done. >-- >Fred Hamilton Any views, comments, or ideas expressed here >Harris Semiconductor are entirely my own. Even good ones. >Santa Clara, CA -- Peter Cherna, Software Engineer, Commodore-Amiga, Inc. {uunet|rutgers}!cbmvax!peter peter@cbmvax.cbm.commodore.com My opinions do not necessarily represent the opinions of my employer. "A friend of mine is into Voodoo Acupuncture. You don't have to go. You'll just be walking down the street and ..... oooohhh, that's much better..." - Steven Wright