Let's explain it better, I have my game's data into .pak files, I extract them, load the content, delete the files, delete the folder.
The problem is that randomly instead of being extracted inside of the game's path, they are extracted outside, and the folders and/or the files obviously are not deleted there. (it happens just with some of them, randomly)
So the bug it's in the get dir() or more probably in the set dir command, this is the function I use to delete the file with the folders:
function cancellaCartella(cartella$)
set dir cartella$
perform checklist for files
for t=1 to checklist quantity()
delete file checklist string$(t)
next t
set dir ".."
delete directory cartella$
set dir ".."
endfunction