Change your
bool filesDeleted;
bool dirsDeleted;
to
bool filesDeleted = false;
bool dirsDeleted = false;
These are local variables and they must be assinged before use them.
A local variable is not automatically initialized and thus has no default value. For the purpose of definite assignment checking, a local variable is considered initially unassigned.