You cannot keep any food open for even a small fraction of time, and you will see flies sitting on the food which makes it unsuitable to eat.
The best way to prevent fly problems in a home is to eliminate the sources that are attracting them.
The house fly prefers to eat and lay its eggs in animal waste and other decaying organic matter such as decaying vegetables and fruits, and garbage.
A female house fly can lay up to 500 eggs, in batches of 75–100 eggs each.
The eggs hatch after a day. As larvae (or “maggots”), the flies go through three stages of larval growth, known as instars.
After a week of larval growth, the larvae climb to a cool, dry place and transform into pupae. Adult flies emerge from the pupae and live for 2–4 weeks.
Keeping Flies Out of the House
1 – First of all keeping flies away is often a matter of cleanliness. Keep your house clean and make sure your yard is clean as well. Take the trash out as soon as the garbage can is full. Remove compost to the compost pile, and don’t leave food uncovered.
Keep also, a tight fitting lid on your outdoor garbage can and keep it far away from the entrance of your home.
2 – Throw out overly ripe fruit or put it in your refrigerator. Wash out cans of food before discarding the trash. Run water inside empty soda cans to clean out residue.
3 – Invest in window screens and screen doors and encourage your children to close screen doors quickly when they enter or leave the house. Flies are ridiculously small and therefore can find their way into your home through very small openings. Seal cracks around windows and doors where flies may enter.
4 – Place a fan near the door, directing wind outside, so flies aren’t able to pass through.
5– A good indoor trap is an ultraviolet trap. Flies are attracted to the UV rays, and once inside, they get zapped.
6- Flypaper works well in small, confined areas for smaller populations of flies as long as no more flies are getting in. Make your own inexpensive flypaper. Start by cutting strips of brown craft paper; soak them in a solution of 1/4 cup of maple or corn syrup and 1 tbsp. each of white and brown sugar. Let them dry overnight. Hang the strips near problematic areas.
7 – Hang pomanders on doors: citrus peel is a great repellent.
8 – Place potted basil plants in infested areas.
9 – Use a fly swatter to kill flies already inside your house.
10 – Boric acid is a commonly used natural insecticide. Powdered boric acid is placed in places where insects congregate. The powder sticks to the hairs on the insects body. When they preen themselves, they ingest the boric acid and die.