i was testing some datapacks one by one and when i wanted to delete one i got Error message saying "the file in open in another program" so i exited the world and tried again but the same Error occurred so i closed the game relogged my user and then i was able to delete the datapack .zip file
Yes. That is how program files work. You can't delete them while the program is still running, you have to close it first.