Yes, if you know in advance. Keep the bowl at room temperature, and out of direct sunlight, stirring the contents every day to refresh the surface and avoid mould. Add a tablespoon of unrefined sugar, honey or maple syrup for every 250g water, stir to dissolve, then cover with a cloth  this will not only protect the fruit from flies, but it will also allow the free flow of oxygen in the bowl or jar. Put on a scale, set the reading to zero and add cold water just to cover, taking note of the weight of the water. But that is not the rule but the exception.
Sugar and fluids getting too hot can cause flies.
( z0 possible :ARG1 ( z1 cause :ARG0 ( z2 get :ARG1 ( z3 and :op ( z4 sue ) :op ( z5 fluid ) ) :ARG2 ( z6 hot :ARG1 z3 :ARG2-of ( z7 have-degree :ARG1 z3 :ARG3 ( z8 too ) ) ) ) :ARG1 ( z9 fly ) ) )
(z0 / possible-01
    :ARG1 (z1 / cause-01
              :ARG0 (z2 / get-03
                        :ARG1 (z3 / and
                                  :op1 (z4 / sue-02)
                                  :op2 (z5 / fluid))
                        :ARG2 (z6 / hot-05
                                  :ARG1 z3
                                  :ARG2-of (z7 / have-degree-91
                                               :ARG1 z3
                                               :ARG3 (z8 / too))))
              :ARG1 (z9 / fly-01)))
Sugar and fluids getting too hot can cause flies .
z3 :op1 z4
z3 :op2 z5
z2 :ARG1 z3
z7 :ARG1 z3
z7 :ARG3 z8
z6 :ARG2-of z7
z2 :ARG2 z6
z6 :ARG1 z3
z0 :ARG1 z1
z1 :ARG0 z2
z1 :ARG1 z9