trouble deleting file

Blitz3D Forums/Blitz3D Beginners Area/trouble deleting file

Josaih6/10(Posted 2009) [#1]
i have created a function that is supposed to (and has up till now) delete directories that are not empty yet. the idea is that it reads a directory and if it sees a data file it deletes it and if it sees a directory it runs it's self on it. when it gets done reading, it closes the directory and deletes it. however when i try to use it to delete a record in a simple game it doesn't work right. it fails to delete one of the data files and because of that fails to delete the directory. this problem does not occur when the function is run separately from the rest of the program.

any ideas?


GfK(Posted 2009) [#2]
Forgotten to close a file somewhere?

Accidentally set a file to read-only?


Zethrax(Posted 2009) [#3]
this problem does not occur when the function is run separately from the rest of the program.


As GFK said, it sounds like the main program has opened a file and not closed it properly. Identify which file is causing the problem, and then find out where in your program that file is being accessed, and where it should be being closed, and you should be able to narrow down the bug.