home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 308.lha / treewalk / patname.ftw < prev    next >
Encoding:
Text File  |  1980-12-05  |  1.0 KB  |  31 lines

  1. /*
  2.  * patname - do grep-type matching on the filename, using the pattern
  3.  * in tw.patname.
  4.  *
  5.  *    Copyright (C) 1989  Mike Meyer
  6.  *
  7.  *    This program is free software; you can redistribute it and/or modify
  8.  *    it under the terms of the GNU General Public License as published by
  9.  *    the Free Software Foundation; either version 1, or any later version.
  10.  *
  11.  *    This program is distributed in the hope that it will be useful,
  12.  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  *    GNU General Public License for more details.
  15.  *
  16.  *    You should have received a copy of the GNU General Public License
  17.  *    along with this program; if not, write to the Free Software
  18.  *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  */
  20.  
  21. address command
  22. 'echo >ram:twpat1' arg(2)
  23. 'grep.lattice >ram:twpat2 -c -q' getclip('tw.patname') 'ram:twpat1'
  24. num = 0
  25. if open(in, 'ram:twpat2') then do
  26.     parse value readln(in) with num .
  27.     call close in
  28.     end
  29. 'delete ram:twpat1 ram:twpat2'
  30. return num > 0
  31.