docgipe - I would agree, but these are Argentine Ants - which are non-native and a real nuisance in California. You can't leave anything out in the kitchen (I have to keep sugar and flour in the fridge!). They will also come in during the summer just for water. Granted - it's better than vermin, but really annoying.
Jman, I believe if you keep the compost moist and do not put any sugary stuff in there... it will help keep ants out. You may have to choose whether you want to be able to compost stuff like apple cores and fruit peelings... and put up with ants, but depending on h ow voracious they are they may leave that level of sugar alone... but no throwing in the leftover birthday cake -- or the like.
Those invading ants though, none of this may make any difference to them, but those are some steps to take you can try and see if or how much they help.
Deal with the house sitituation with chemicals found in all hardware stores in this area. Ants follow a scent trail to an from food and water. Place the poison by the entry point of the trail. The ants from the nest entering the house will die in two weeks or less. Don't drive yourself nuts attacking the natural every day home part of which is your compost pile.
As far as your flour and suggar go any container with a lid will keep them out. This is true of any food containing the suggar or flour. A bit more difficult for aged fingers like mine but plastic baggies work fine too. The little bit you spill is always an attraction all over your house.
I have red ants in mine. I was forking compost into my raised bed and every now and then I would stop and spray with insecticidal soap. Then I used an open bag of soil to ammend the bed with as well. It was composed mainly of ants!!! I don't think I can use soap to kill the ants in this bag of dirt.
Does anyone know a way to kill them? I think I will try spreading the dirt out on a tarp in my driveway. They have an exoskeleton, maybe diatomacious earth would work.
I had quite an infestation of ants, the stinging ones, in my compost pile. I spread the compost out on a tarp in the full Tucson sun and they fled in a hurry! They haven't been back yet but I know it's just a matter of time. They are all part of the food chain and compost is pretty flavorful to them, I'm guessing!
The most effective ant control I use is a very small bottle labeled Terro. One needs to set up a feeding station at the points of entry. This is very easy to do and is absolute. They take it home for their nest partners. Within two weeks no more ants. This is a chemical that works and one of the reasons I say I am 98% organic and the other two percent I lie about. LOL
I use Terro as well--I don't know if they have different kinds of baits but the one I use has boric acid as the active--it's not organic but it is much safer and not nearly as nasty as other types of ant products.