Hi,

Mick is right. There is something wrong with the logic.
I commented out the lines, and the files get deleted without
any problem!

Thank You everyone!
^^