home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_01_04 / 1n04014a < prev    next >
Text File  |  1990-08-06  |  699b  |  39 lines

  1. #include "filesrch.h"
  2. #include "stdio.h"
  3. #include "string.h"
  4.  
  5. void print_file(char * dir, FILE_DATA * f);
  6.  
  7. int main(int argc, char * argv [])
  8.     {
  9.     int i;
  10.  
  11.     if (argc < 2)
  12.         {
  13.         puts("\ausage: whereis filespec [filespec2]\
  14.               [filespec3] [...]");
  15.         return 1;
  16.         }
  17.  
  18.     for (i = 1; i < argc; ++i)
  19.         {
  20.         TreeFind(argv[i],0,"\\",print_file);
  21.         }
  22.  
  23.     return 0;
  24.     }
  25.  
  26. void print_file(char * dir, FILE_DATA * f)
  27.     {
  28.     char filename[128];
  29.  
  30.     strcpy(filename,dir);
  31.  
  32.     if (filename[strlen(filename) - 1] != '\\')
  33.         strcat(filename,"\\");
  34.  
  35.     strcat(filename,f->name);
  36.  
  37.     puts(filename);
  38.     }
  39.