in reply to Caught in a loop

Without the rest of the code within the loops, it becomes more of a guessing game, but I'll give it a shot.

My first guess is that a file is placed in the Input directory that doesn't match your regular expression, and as long as that is true, B is going to continue to be printed. Why it might "pull out" when you hit control-C, I couldn't say...

-Scott