in reply to Re: File test in grep not excluding current directory (chdir)
in thread File test in grep not excluding current directory

I can verify that it calls wanted before preprocess - but why? The docs indicate otherwise:

"Your preprocessing function is called after readdir(), but before the loop that calls the wanted() function. It is called with a list of strings (actually file/directory names) and is expected to return a list of strings. The code can be used to sort the file/directory names alphabetically, numerically, or to filter out directory entries based on their name alone."

That says to me that it filters before looping, which is exactly what I would expect, except it doesn't. Okay, lesson learned.

1 Peter 4:10
  • Comment on Re^2: File test in grep not excluding current directory (chdir)