Author Topic: Problems with exclude filter in Find in Files dialog  (Read 5787 times)

abudinsz

  • Guest
Problems with exclude filter in Find in Files dialog
« on: November 09, 2006, 12:24:42 am »
I'm running into a problem with specifying an exclude filter in the Find in Files in SEv11. The directory I need to exclude has a colon ':' in it (ie. /foo/m:/stuff) So the filter I used is */m:* but this for some reason excludes all matches in my entire tree. Something about the colon in the search string makes it go wild.

Is there anyway to escape the colon to really mean a colon (I tried the usual '/' or quoting but nothing seemed to help. This is on a Linux system and is driving me nuts because the file system under the .../m:/... dir is huge! Any ideas? Does the exclude filter takes regexp as well? What is the actual supported syntax?

Thanks,
Andras

Graeme

  • Senior Community Member
  • Posts: 2366
  • Hero Points: 313
Re: Problems with exclude filter in Find in Files dialog
« Reply #1 on: November 15, 2006, 12:15:56 pm »
I'm running into a problem with specifying an exclude filter in the Find in Files in SEv11. The directory I need to exclude has a colon ':' in it (ie. /foo/m:/stuff) So the filter I used is */m:* but this for some reason excludes all matches in my entire tree. Something about the colon in the search string makes it go wild.

Is there anyway to escape the colon to really mean a colon (I tried the usual '/' or quoting but nothing seemed to help. This is on a Linux system and is driving me nuts because the file system under the .../m:/... dir is huge! Any ideas? Does the exclude filter takes regexp as well? What is the actual supported syntax?

Thanks,
Andras

I don't use Linux much but it appears ':' is a path separator on Unix (see line 46 of slick.sh) so it's a bit surprising you have a directory name with colon in it.

At line 104 of bgsearch.e you'll see this code
Code: [Select]
   if (file_exclude != '') {
      _str list = file_exclude;
      while (list != '') {
         parse list with file_exclude (PATHSEP) list;
         if (file_exclude != '') {
            if (exclude_list == '') {
               exclude_list = ' -exclude ':+maybe_quote_filename(file_exclude);
            } else {
               strappend(exclude_list, ' 'maybe_quote_filename(file_exclude));
            }
         }
      }
   }

The line
parse list with file_exclude (PATHSEP) list;
is breaking the text from the exclude edit box into paths.
You could change this line to use whatever path separator you think you'll use - then use "load module" on the macro menu.  Can't guarantee this'll work though - try it and see.

Graeme