Title: glob Version: 1.0 Submitted: Dec 1 1986 Author: seismo!mcvax!guido (Guido van Rossum) Submittor: seismo!mcvax!guido (Guido van Rossum) Description: 'Globbing' library routine [ A few items: 1) If you use csh, you have to invoke the test program at "./glob"; 2) A comment in the code says [...] is not implemented; it is; 3) As the README says, some sites will have to add -Dindex=strchr to the CFLAGS variable in the Makefile; 4) This uses the opendir() family of routines. --r$ ] Glob -- expand meta-characters in file names -- by Guido van Rossum This is a filename 'globbing' routine that I wrote. Besides expanding *, ? and [...] exactly like sh(1), it also replaces initial ~ or ~user by user's home directory, replaces initial $var by the contents of the environment variable, and has a quoting mechanism whereby any of the magic characters can be quoted by '\' (including '\' itself). It is really intended for inclusion in some larger program, but there is a small test program that expands patterns given as arguments. You should have received the following files: README this file glob.c the code main.c test program glob.3 manual page Makefile make file Portability issues: I have only been able to test it on a VAX running 4.3-beta, but I believe it can be ported to anything that supports opendir, readdir and closedir. If you don't have index, substitute strchr using the -D flag to the C compiler. The program passes lint except for the usual complaints about malloc and strcpy. This software is copyright (c) 1986 by Stichting Mathematisch Centrum. You may use, modify and copy it, provided this notice is present in all modified or unmodified copies, and provided you don't make money for it. *** You may only distribute the set of files mentioned above as a whole. ***