/* * FILE: psearch.c * PURPOSE: search files through possible recursive path * VERSION: 1.0 (Oct. 1995) * AUTHOR: Piet Tutelaers */ #include #include "basics.h" /* pstat, my_stat(), fatal(), msg() */ #include "filenames.h" /* my_fopen() */ #include "psearch.h" /* search_file() */ int main(int argc, char *argv[]) { char *path, *file, *fn; /* get path and file arguments */ if (argc != 3) fatal("Usage: psearch path file\n"); path = argv[1]; file = argv[2]; /* find in */ /* pstat = my_stat; */ fn = search_file(path, file, NONFATAL); if (fn == NULL) fatal("%s not found\n", file); printf("%s\n", fn); exit(0); }