in reply to -f command problem

How do the files that don't increment the counter differ from those that do?

Also please post enough code that we can actually run it and reproduce your problem, as is it's just guessing in the dark.