Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!crdgw1!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.unix.questions Subject: Re: Wildcard Expansion By Shell Message-ID: <7262@auspex.auspex.com> Date: 19 Apr 91 18:33:41 GMT References: <4056@risky.Convergent.COM> <1991Apr17.174147.16367@athena.mit.edu> Distribution: usa Organization: Auspex Systems, Santa Clara Lines: 21 > The shell opens directories using opendir(), reads the entries in the >directory and compares the pattern it is trying to match against each of them. Some old and, at this point, fairly tired versions of UNIX don't have "opendir()" or "readdir()" (yes, you can interpret this as meaning that I believe that V7 is "old and tired" at this point); if you're unlucky enough to be stuck with a system without it, some publicly-available implementations of "opendir()" and "readdir()", at least for systems with V7-ish directory formats, are available. (Doug Gwyn's is the main one out there.) Most flavors of UNIX don't come with routines to do the pattern matching that the shell does; some do, but they may not all put them in the same place. I think publicly-available routines to do that are also available. > There's nothing magic involved; no special system calls, Well, some UNIX systems may use a special system call to implement "readdir()", but that's hidden behind "readdir()", which is what somebody who wants to read the entries in a directory should use.