I've got a compost pile that has a nasty population of fruit flies. Probably started because I left veggie waste in the open for too long before adding it to the bin and dressing it.
Is there easy way to keep them from reproducing? Maybe a garden-safe additive I can put on the pile? The bin is outdoors and well away from my house, so they're not a real problem, but they make turning the pile a serious annoyance.
I usually take a shovel full of dirt off the top and place the fruit and put that dirt back on. Rotting fruit smell travels for miles in the air apparently. I also remember fruit flies laying their larvae directly on to the fruit surface but you might have to look that up too. Know your enemy.