Re: Find File: Skip Directory matching a pattern



Am Dienstag, 30. Mai 2006 18:12 schrieb Nabil Sayegh:
I often search very large filesystems for a file and in many cases there
are huge directories, that I would like to skip while searching.
[...]

Apparently there exists a variable "find_ignore_dirs" in the Misc section, but 
it seems like it only matches absolute paths:

                if (find_ignore_dirs){
                    int found;
                    char *temp_dir = g_strconcat (":", tmp, ":", (char *) 
NULL);

                    found = strstr (find_ignore_dirs, temp_dir) != 0;
                    g_free (temp_dir);
                    if (found)
                        g_free (tmp);
                    else
                        break;
                } else
                    break;

I attached a patch that changes find_ignore_dirs to be a regex instead of a 
colon delimited string. That way one may specify any pattern needed including 
absolute paths.
I used mc-4.6.1-2 from debian for the patch.

rgds
-- 
 Nabil Sayegh

Attachment: mc-4.6.1-find_ignore_dirs_regex.diff
Description: Text Data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]